encoding/json: inconsistent handling of keys with spaces #3887
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.
The text was updated successfully, but these errors were encountered: