gojson icon indicating copy to clipboard operation
gojson copied to clipboard

Prefer interface{} over struct{} for empty object: {}

Open nstogner opened this issue 8 years ago • 0 comments

I think it would be more desirable to translate {"abc": {}} as

...
Abc interface{} `json:"abc"`

rather than

...
Abc struct{} `json:"abc"`

The empty interface would be more useful than a struct with no fields. Does this sound reasonable?

nstogner avatar Sep 24 '16 22:09 nstogner