Skip to content

Commit b0e4ba2

Browse files
authored
docs: document omitzero (#1509)
## Fixes Or Enhances Added missing documentation for the `omitzero` tag.
1 parent 79fba72 commit b0e4ba2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ only for the nil-values).
201201
202202
Usage: omitnil
203203
204+
# Omit Zero
205+
206+
Allows to skip the validation if the value is a zero value.
207+
For pointers, it checks if the pointer is nil or the underlying value is a zero value.
208+
For slices and maps, it checks if the value is nil or empty.
209+
Otherwise, behaves the same as omitempty.
210+
211+
Usage: omitzero
212+
204213
# Dive
205214
206215
This tells the validator to dive into a slice, array or map and validate that

0 commit comments

Comments
 (0)