Files
renovate[bot] ffb96ad8b6 fix(deps): update github.com/crc-org/vfkit digest to f3c783d
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-01 08:20:08 +00:00

17 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
}
}