-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #45669 Change-Id: Idec483a03968cc671c8da27804589008b10864a1
- Loading branch information
1 parent
8014360
commit 903dea1
Showing
3 changed files
with
171 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
When marshaling, a struct field with the new `omitzero` option in the struct field | ||
tag will be omitted if its value is zero. If the field type has an `IsZero() bool` | ||
method, that will be used to determine whether the value is zero. Otherwise, the | ||
value is zero if it is [the zero value for its type](/ref/spec#The_zero_value). | ||
|
||
If both `omitempty` and `omitzero` are specified, the field will be omitted if the | ||
value is either empty or zero (or both). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters