-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/json: inconsistent handling of keys with spaces #3887
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
Labels
Milestone
Comments
It looks like JSON tag values don't compose naturally, which makes it unintuitive. For example: type SharedFields struct { Name string `json:"myName"` Number int `json:"my number"` } type Foo struct { SharedFields fooName string `json:"foo name"` } type Moo struct { SharedFields mooName string `json:"moo name"` } Here, both Moo and Foo would not be able to properly decode fields that were obtained through composition. |
Re comment #1, I think that's a separate issue (anonymous fields, issue #3069). Note, by the way, that fooName and mooName are unexported so ignored by the package no matter what. |
This issue was closed by revision 475f3df. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
The text was updated successfully, but these errors were encountered: