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 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

This comment has been minimized.

Copy link
Contributor Author

@bpowers bpowers commented Apr 18, 2012

@robpike

This comment has been minimized.

Copy link
Contributor

@robpike robpike commented Apr 25, 2012

Comment 2:

This issue was closed by revision 52f122d.

Status changed to Fixed.

@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Apr 25, 2012

Comment 3:

This issue was closed by revision 3a1462cae57f.

@bpowers bpowers added fixed labels Apr 25, 2012
robpike added 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.