Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nstogner opened this issue Sep 24, 2016 · 0 comments
Open

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

nstogner opened this issue Sep 24, 2016 · 0 comments

Comments

@nstogner
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant