-
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: Ic13523c0b3acdfc5b3e29a717bc62fde302ed8fd GitHub-Last-Rev: 57030f2 GitHub-Pull-Request: #69622 Reviewed-on: https://go-review.googlesource.com/c/go/+/615676 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Michael Knyszek <mknyszek@google.com>
- Loading branch information
1 parent
41d189a
commit e86982c
Showing
3 changed files
with
248 additions
and
4 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