You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ianlancetaylor
changed the title
marshaling a zero value json.Marhaler interface struct field panics
encoding/json: marshaling a zero value json.Marshaler interface struct field panics
Jun 12, 2016
Also if the code is bailing early on seeing a nil json.Marshaler value, then it shouldn't; it's possible for a json.Marshaler whose concrete type is nil to correctly implement the method.
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6
go env
)?darwin/amd6
https://play.golang.org/p/MsVP9u-We5
{"M":null}
https://golang.org/pkg/encoding/json/#Marshal says "A nil interface value encodes as the null JSON object."
panic: interface conversion: interface is nil, not json.Marshaler
The text was updated successfully, but these errors were encountered: