diff options
Diffstat (limited to 'vendor/github.com/go-playground/validator/v10/options.go')
-rw-r--r-- | vendor/github.com/go-playground/validator/v10/options.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/go-playground/validator/v10/options.go b/vendor/github.com/go-playground/validator/v10/options.go index 1dea56fd7..86a0db218 100644 --- a/vendor/github.com/go-playground/validator/v10/options.go +++ b/vendor/github.com/go-playground/validator/v10/options.go @@ -14,3 +14,13 @@ func WithRequiredStructEnabled() Option { v.requiredStructEnabled = true } } + +// WithPrivateFieldValidation activates validation for unexported fields via the use of the `unsafe` package. +// +// By opting into this feature you are acknowledging that you are aware of the risks and accept any current or future +// consequences of using this feature. +func WithPrivateFieldValidation() Option { + return func(v *Validate) { + v.privateFieldValidation = true + } +} |