mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-28 01:50:30 +00:00
66b77acb1c
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16 lines
630 B
Go
16 lines
630 B
Go
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
|
|
}
|
|
}
|