summaryrefslogtreecommitdiff
path: root/vendor/github.com/go-playground/validator/v10/cache.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-03-11 10:12:06 +0000
committerLibravatar GitHub <noreply@github.com>2024-03-11 10:12:06 +0000
commite24efcac8b67baa9454bf27631e5e49f898a88d4 (patch)
treed9adec2f05e1d8714edee66062a4b95a81ee2a61 /vendor/github.com/go-playground/validator/v10/cache.go
parent[bugfix] Fix whitespace move_id issue (#2742) (diff)
downloadgotosocial-e24efcac8b67baa9454bf27631e5e49f898a88d4.tar.xz
[chore]: Bump github.com/gin-contrib/cors from 1.5.0 to 1.7.0 (#2745)
Diffstat (limited to 'vendor/github.com/go-playground/validator/v10/cache.go')
-rw-r--r--vendor/github.com/go-playground/validator/v10/cache.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/go-playground/validator/v10/cache.go b/vendor/github.com/go-playground/validator/v10/cache.go
index bbfd2a4af..b6bdd11a1 100644
--- a/vendor/github.com/go-playground/validator/v10/cache.go
+++ b/vendor/github.com/go-playground/validator/v10/cache.go
@@ -20,6 +20,7 @@ const (
typeOr
typeKeys
typeEndKeys
+ typeOmitNil
)
const (
@@ -125,7 +126,7 @@ func (v *Validate) extractStructCache(current reflect.Value, sName string) *cStr
fld = typ.Field(i)
- if !fld.Anonymous && len(fld.PkgPath) > 0 {
+ if !v.privateFieldValidation && !fld.Anonymous && len(fld.PkgPath) > 0 {
continue
}
@@ -252,6 +253,10 @@ func (v *Validate) parseFieldTagsRecursive(tag string, fieldName string, alias s
current.typeof = typeOmitEmpty
continue
+ case omitnil:
+ current.typeof = typeOmitNil
+ continue
+
case structOnlyTag:
current.typeof = typeStructOnly
continue