summaryrefslogtreecommitdiff
path: root/vendor/github.com/go-playground/validator/v10/options.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-11-27 13:15:03 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-27 13:15:03 +0000
commit66b77acb1c8b86f0be3836ccaf31683c0bfa317a (patch)
tree9a255a8ea8ef97229b6d75d17de45bdac1755be9 /vendor/github.com/go-playground/validator/v10/options.go
parent[bugfix] Add Actor to outgoing poll vote Create; other fixes (#2384) (diff)
downloadgotosocial-66b77acb1c8b86f0be3836ccaf31683c0bfa317a.tar.xz
[chore]: Bump github.com/gin-contrib/cors from 1.4.0 to 1.5.0 (#2388)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/go-playground/validator/v10/options.go')
-rw-r--r--vendor/github.com/go-playground/validator/v10/options.go16
1 files changed, 16 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
new file mode 100644
index 000000000..1dea56fd7
--- /dev/null
+++ b/vendor/github.com/go-playground/validator/v10/options.go
@@ -0,0 +1,16 @@
+package validator
+
+// Option represents a configurations option to be applied to validator during initialization.
+type Option func(*Validate)
+
+// WithRequiredStructEnabled enables required tag on non-pointer structs to be applied instead of ignored.
+//
+// This was made opt-in behaviour in order to maintain backward compatibility with the behaviour previous
+// to being able to apply struct level validations on struct fields directly.
+//
+// It is recommended you enabled this as it will be the default behaviour in v11+
+func WithRequiredStructEnabled() Option {
+ return func(v *Validate) {
+ v.requiredStructEnabled = true
+ }
+}