go - JSON encoding a zero value embedded json.Marshaler panics, would you consider this a bug? -
json.newencoder(os.stdout).encode(struct { m json.marshaler }{})
panics:
panic: interface conversion: interface nil, not json.marshaler
https://play.golang.org/p/vur0jjq6sf
i'd explicitly state interface should marshal itself:
type thing interface { json.marshaler type() string .... }
would consider bug? if no, why not?
Comments
Post a Comment