We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There doesn't appear to be a way to unmarshal a JSON field with an empty string key into a struct.
For example https://play.golang.org/p/on_EMTAPGV2
package main import ( "encoding/json" "fmt" ) func main() { data := []byte(`{"": "foo", "spam": "egg"}`) var obj struct { Thing string `json:""` Spam string `json:"spam"` } json.Unmarshal(data, &obj) fmt.Printf("%#v", obj) }
The text was updated successfully, but these errors were encountered:
Duplicate of #22518
Sorry, something went wrong.
Yep.
No branches or pull requests
There doesn't appear to be a way to unmarshal a JSON field with an empty string key into a struct.
For example https://play.golang.org/p/on_EMTAPGV2
The text was updated successfully, but these errors were encountered: