forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes golang#45669 Change-Id: Idec483a03968cc671c8da27804589008b10864a1
- Loading branch information
1 parent
b17a55d
commit aacdc51
Showing
3 changed files
with
143 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,11 @@ | ||
When marshaling, the `omitzero` option specifies that the struct field should be | ||
omitted if the field value is zero as determined by the `IsZero() bool` method | ||
if present, otherwise based on whether the field is the zero Go value (according | ||
to [reflect.Value.IsZero]). | ||
|
||
This option has no effect when unmarshaling. If `omitempty` is specified together | ||
with `omitzero`, whether a field is omitted is based on the logical OR of the two. | ||
|
||
This will mean that `omitzero` of a slice omits a nil slice but emits [] for a | ||
zero-length non-nil slice (and similar for maps). It will also mean that | ||
`omitzero` of a [time.Time] omits time.Time{}. |
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