encoding/json: MarshalJSON not called in value contexts for integer types #23263
Labels
Comments
schani
added a commit
to quicktype/quicktype
that referenced
this issue
Dec 27, 2017
It's a Go bug: golang/go#23263
The issue is that |
Also note that elements in maps aren't addressable so any typical automatic T to *T receiver switch sugar doesn't happen since the map element can't have its pointer addr taken. |
schani
added a commit
to quicktype/quicktype
that referenced
this issue
Feb 27, 2018
In the case where you had a class type with a union property, and that class type was the value type of a map, the union wouldn't use the custom unmarshaller, because of complicated Go stuff: golang/go#23263 (comment)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This behavior is counterintuitive and requires bookkeeping to figure out which types are in a value context under which circumstances.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/HuQg9qdj4HE
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: