Skip to content

Release 5.11

Compare
Choose a tag to compare
@deankarn deankarn released this 04 Aug 01:37
· 3 commits to v5 since this release

Add "exists" tag

exists
Is a special tag without a validation function attached. It is used when a field
is a Pointer, Interface or Invalid and you wish to validate that it exists.
Example: want to ensure a bool exists if you define the bool as a pointer and
use exists it will ensure there is a value; couldn't use required as it would
fail when the bool was false. exists will fail is the value is a Pointer, Interface
or Invalid and is nil. (Usage: exists)

see example in issue #142 thanks @davisford