ChimeraCoder / gojson

Automatically generate Go (golang) struct definitions from example JSON
GNU General Public License v3.0
2.67k stars 207 forks source link

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

Open nstogner opened 8 years ago

nstogner commented 8 years ago

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?