Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/json: '@' not allowed in tag name #3546

Closed
bpowers opened this issue Apr 18, 2012 · 3 comments
Closed

encoding/json: '@' not allowed in tag name #3546

bpowers opened this issue Apr 18, 2012 · 3 comments

Comments

@bpowers
Copy link
Contributor

bpowers commented Apr 18, 2012

What steps will reproduce the problem?
With a type like:
type LogstashMsg struct {
    Source  string     `json:"@source"`
}

What is the expected output?
the emitted json key should be "@source"

What do you see instead?
the json key will be emitted as "Source"


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
linux

Which version are you using?  (run 'go version')
go version weekly.2012-03-27 +b9cbd32246e3
(tip)

Please provide any additional information below.
CL forthcoming
@bpowers
Copy link
Contributor Author

bpowers commented Apr 18, 2012

Comment 1:

http://golang.org/cl/6048047

@robpike
Copy link
Contributor

robpike commented Apr 25, 2012

Comment 2:

This issue was closed by revision 52f122d.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Apr 25, 2012

Comment 3:

This issue was closed by revision 3a1462cae57f.

robpike pushed a commit that referenced this issue May 11, 2015
««« backport 233ff5d46b3d
encoding/json: allow punctuation in tag names

everything except backslash and the quote chars is fair game.

Fixes #3546.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6048047

»»»
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants