package validator import ( "github.com/go-playground/validator/v10" ) var ( v = validator.New() ) func Struct(val any) error { return v.Struct(val) } func init() { _ = v.RegisterValidation("optional", func(f validator.FieldLevel) bool { return true }) }