json.NewEncoder(os.Stdout).Encode(struct {
M json.Marshaler
}{})
panics:
panic: interface conversion: interface is nil, not json.Marshaler
https://play.golang.org/p/Vur0JJq6SF
I'd like to explicitly state for my interface that it should marshal itself:
type thing interface {
json.Marshaler
Type() string
....
}
would you consider this a bug? If no, why not?