-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Consider deprecating omitzero in favor of a more general omitempty #120
Comments
What if the zero value is acceptable but given a pointer nil means it should be left out. |
Must have misunderstood your original wording. On Wednesday, March 2, 2016, Caleb Spare [email protected] wrote:
|
The problem with changing this now is that it's an incompatible change; what if people have If this was written today: yeah, this would obviously be the correct way to do it. But now we're kind of stuck with it until we do a v2 (if ever). |
The JSON "omitzero" proposal was accepted: golang/go#45669 :
|
It would be better if omitempty handled a variety of zero values -- including for numeric types -- as encoding/json does, rather than having a separate omitzero concept.
The text was updated successfully, but these errors were encountered: