encoding/json: custom type marshaling doesn't work for map values #55890
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
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
)?go env
OutputWhat did you do?
If you define custom marshaling/unmarshaling functions for a type,
json.Marshal
doesn't use them when the custom type is used as value in a map.https://go.dev/play/p/uggz6OAQo_J
What did you expect to see?
I expect the custom type marshaling functions to be respected even when the custom type is a value in a map
What did you see instead?
JSON reverts to a default marshaling/unmarshaling function
The text was updated successfully, but these errors were encountered: