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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -