|
|
@ -2,93 +2,343 @@ package validator_test |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"log" |
|
|
|
|
|
|
|
"testing" |
|
|
|
"testing" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/joeybloggs/go-validate-yourself" |
|
|
|
"github.com/joeybloggs/go-validate-yourself" |
|
|
|
|
|
|
|
. "gopkg.in/check.v1" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// type UserDetails struct {
|
|
|
|
type SubTest struct { |
|
|
|
// Address string `validate:"omitempty,length=6"`
|
|
|
|
Test string `validate:"required"` |
|
|
|
// Sub struct {
|
|
|
|
} |
|
|
|
// A string `validate:"required"`
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type UserDetails struct { |
|
|
|
type TestString struct { |
|
|
|
Address string `validate:"omitempty,length=6"` |
|
|
|
Required string `validate:"required"` |
|
|
|
Sub struct { |
|
|
|
Len string `validate:"len=10"` |
|
|
|
|
|
|
|
Min string `validate:"min=1"` |
|
|
|
|
|
|
|
Max string `validate:"max=10"` |
|
|
|
|
|
|
|
MinMax string `validate:"min=1,max=10"` |
|
|
|
|
|
|
|
OmitEmpty string `validate:"omitempty,min=1,max=10"` |
|
|
|
|
|
|
|
Sub *SubTest |
|
|
|
|
|
|
|
SubIgnore *SubTest `validate:"-"` |
|
|
|
|
|
|
|
Anonymous struct { |
|
|
|
A string `validate:"required"` |
|
|
|
A string `validate:"required"` |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type User struct { |
|
|
|
type TestInt32 struct { |
|
|
|
FirstName string `validate:"required"` |
|
|
|
Required int `validate:"required"` |
|
|
|
Details *UserDetails |
|
|
|
Len int `validate:"len=10"` |
|
|
|
|
|
|
|
Min int `validate:"min=1"` |
|
|
|
|
|
|
|
Max int `validate:"max=10"` |
|
|
|
|
|
|
|
MinMax int `validate:"min=1,max=10"` |
|
|
|
|
|
|
|
OmitEmpty int `validate:"omitempty,min=1,max=10"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type TestUint64 struct { |
|
|
|
|
|
|
|
Required uint64 `validate:"required"` |
|
|
|
|
|
|
|
Len uint64 `validate:"len=10"` |
|
|
|
|
|
|
|
Min uint64 `validate:"min=1"` |
|
|
|
|
|
|
|
Max uint64 `validate:"max=10"` |
|
|
|
|
|
|
|
MinMax uint64 `validate:"min=1,max=10"` |
|
|
|
|
|
|
|
OmitEmpty uint64 `validate:"omitempty,min=1,max=10"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type TestFloat64 struct { |
|
|
|
|
|
|
|
Required int64 `validate:"required"` |
|
|
|
|
|
|
|
Len int64 `validate:"len=10"` |
|
|
|
|
|
|
|
Min int64 `validate:"min=1"` |
|
|
|
|
|
|
|
Max int64 `validate:"max=10"` |
|
|
|
|
|
|
|
MinMax int64 `validate:"min=1,max=10"` |
|
|
|
|
|
|
|
OmitEmpty int64 `validate:"omitempty,min=1,max=10"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type TestSlice struct { |
|
|
|
|
|
|
|
Required []int `validate:"required"` |
|
|
|
|
|
|
|
Len []int `validate:"len=10"` |
|
|
|
|
|
|
|
Min []int `validate:"min=1"` |
|
|
|
|
|
|
|
Max []int `validate:"max=10"` |
|
|
|
|
|
|
|
MinMax []int `validate:"min=1,max=10"` |
|
|
|
|
|
|
|
OmitEmpty []int `validate:"omitempty,min=1,max=10"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func Test(t *testing.T) { TestingT(t) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type MySuite struct{} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _ = Suite(&MySuite{}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func AssetStruct(s *validator.StructValidationErrors, structFieldName string, expectedStructName string, c *C) *validator.StructValidationErrors { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val, ok := s.StructErrors[structFieldName] |
|
|
|
|
|
|
|
c.Assert(ok, Equals, true) |
|
|
|
|
|
|
|
c.Assert(val, NotNil) |
|
|
|
|
|
|
|
c.Assert(val.Struct, Equals, expectedStructName) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return val |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// func Test(t *testing.T) { TestingT(t) }
|
|
|
|
func AssertFieldError(s *validator.StructValidationErrors, field string, expectedTag string, c *C) { |
|
|
|
//
|
|
|
|
|
|
|
|
// type MySuite struct{}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// var _ = Suite(&MySuite{})
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// func (s *MySuite) SetUpTest(c *C) {
|
|
|
|
|
|
|
|
// s.dir = c.MkDir()
|
|
|
|
|
|
|
|
// // Use s.dir to prepare some data.
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// func RecursiveErrorReporter(e *validator.StructValidationErrors) {
|
|
|
|
val, ok := s.Errors[field] |
|
|
|
//
|
|
|
|
c.Assert(ok, Equals, true) |
|
|
|
// // log.Printf("Error within Struct:%s\n", e.Struct)
|
|
|
|
c.Assert(val, NotNil) |
|
|
|
//
|
|
|
|
c.Assert(val.Field, Equals, field) |
|
|
|
// // for _, f := range e.Errors {
|
|
|
|
c.Assert(val.ErrorTag, Equals, expectedTag) |
|
|
|
// // log.Println(f.Error())
|
|
|
|
} |
|
|
|
// // }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestValidateStruct(t *testing.T) { |
|
|
|
func (ms *MySuite) TestStructStringValidation(c *C) { |
|
|
|
|
|
|
|
|
|
|
|
u := &User{ |
|
|
|
tSuccess := &TestString{ |
|
|
|
FirstName: "", |
|
|
|
Required: "Required", |
|
|
|
Details: &UserDetails{ |
|
|
|
Len: "length==10", |
|
|
|
Address: "", |
|
|
|
Min: "min=1", |
|
|
|
Sub: struct { |
|
|
|
Max: "1234567890", |
|
|
|
|
|
|
|
MinMax: "12345", |
|
|
|
|
|
|
|
OmitEmpty: "", |
|
|
|
|
|
|
|
Sub: &SubTest{ |
|
|
|
|
|
|
|
Test: "1", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
SubIgnore: &SubTest{ |
|
|
|
|
|
|
|
Test: "", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
Anonymous: struct { |
|
|
|
A string `validate:"required"` |
|
|
|
A string `validate:"required"` |
|
|
|
}{ |
|
|
|
}{ |
|
|
|
A: "", |
|
|
|
A: "1", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err := validator.ValidateStruct(tSuccess) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tFail := &TestString{ |
|
|
|
|
|
|
|
Required: "", |
|
|
|
|
|
|
|
Len: "", |
|
|
|
|
|
|
|
Min: "", |
|
|
|
|
|
|
|
Max: "12345678901", |
|
|
|
|
|
|
|
MinMax: "", |
|
|
|
|
|
|
|
OmitEmpty: "12345678901", |
|
|
|
|
|
|
|
Sub: &SubTest{ |
|
|
|
|
|
|
|
Test: "", |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
Anonymous: struct { |
|
|
|
|
|
|
|
A string `validate:"required"` |
|
|
|
|
|
|
|
}{ |
|
|
|
|
|
|
|
A: "", |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
errors := validator.ValidateStruct(u) |
|
|
|
err = validator.ValidateStruct(tFail) |
|
|
|
|
|
|
|
|
|
|
|
fmt.Println(errors == nil) |
|
|
|
// Assert Top Level
|
|
|
|
log.Println(errors.Error()) |
|
|
|
c.Assert(err.Struct, Equals, "TestString") |
|
|
|
|
|
|
|
c.Assert(len(err.Errors), Equals, 6) |
|
|
|
// for _, i := range errors {
|
|
|
|
c.Assert(len(err.StructErrors), Equals, 2) |
|
|
|
// fmt.Printf("Error Struct:%s\n", i.Struct)
|
|
|
|
|
|
|
|
//
|
|
|
|
// Assert Fields
|
|
|
|
// for _, j := range i.Errors {
|
|
|
|
AssertFieldError(err, "Required", "required", c) |
|
|
|
//
|
|
|
|
AssertFieldError(err, "Len", "len", c) |
|
|
|
// fmt.Printf("Error Field:%s Error Tag:%s\n", j.Field, j.ErrorTag)
|
|
|
|
AssertFieldError(err, "Min", "min", c) |
|
|
|
// fmt.Println(j.Error())
|
|
|
|
AssertFieldError(err, "Max", "max", c) |
|
|
|
// }
|
|
|
|
AssertFieldError(err, "MinMax", "min", c) |
|
|
|
// }
|
|
|
|
AssertFieldError(err, "OmitEmpty", "max", c) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
// Assert Anonymous embedded struct
|
|
|
|
|
|
|
|
AssetStruct(err, "Anonymous", "", c) |
|
|
|
// func TestValidateField(t *testing.T) {
|
|
|
|
|
|
|
|
//
|
|
|
|
// Assert SubTest embedded struct
|
|
|
|
// u := &User{
|
|
|
|
val := AssetStruct(err, "Sub", "SubTest", c) |
|
|
|
// FirstName: "Dean Karn",
|
|
|
|
c.Assert(len(val.Errors), Equals, 1) |
|
|
|
// Details: &UserDetails{
|
|
|
|
c.Assert(len(val.StructErrors), Equals, 0) |
|
|
|
// "26 Here Blvd.",
|
|
|
|
|
|
|
|
// },
|
|
|
|
AssertFieldError(val, "Test", "required", c) |
|
|
|
// }
|
|
|
|
} |
|
|
|
//
|
|
|
|
|
|
|
|
// err := validator.ValidateFieldByTag(u.FirstName, "required")
|
|
|
|
func (ms *MySuite) TestStructInt32Validation(c *C) { |
|
|
|
//
|
|
|
|
|
|
|
|
// fmt.Println(err == nil)
|
|
|
|
tSuccess := &TestInt32{ |
|
|
|
// fmt.Println(err)
|
|
|
|
Required: 1, |
|
|
|
// }
|
|
|
|
Len: 10, |
|
|
|
|
|
|
|
Min: 1, |
|
|
|
|
|
|
|
Max: 10, |
|
|
|
|
|
|
|
MinMax: 5, |
|
|
|
|
|
|
|
OmitEmpty: 0, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err := validator.ValidateStruct(tSuccess) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tFail := &TestInt32{ |
|
|
|
|
|
|
|
Required: 0, |
|
|
|
|
|
|
|
Len: 11, |
|
|
|
|
|
|
|
Min: -1, |
|
|
|
|
|
|
|
Max: 11, |
|
|
|
|
|
|
|
MinMax: -1, |
|
|
|
|
|
|
|
OmitEmpty: 11, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = validator.ValidateStruct(tFail) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Top Level
|
|
|
|
|
|
|
|
c.Assert(err.Struct, Equals, "TestInt32") |
|
|
|
|
|
|
|
c.Assert(len(err.Errors), Equals, 6) |
|
|
|
|
|
|
|
c.Assert(len(err.StructErrors), Equals, 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Fields
|
|
|
|
|
|
|
|
AssertFieldError(err, "Required", "required", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Len", "len", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Min", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Max", "max", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "MinMax", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "OmitEmpty", "max", c) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestStructUint64Validation(c *C) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tSuccess := &TestUint64{ |
|
|
|
|
|
|
|
Required: 1, |
|
|
|
|
|
|
|
Len: 10, |
|
|
|
|
|
|
|
Min: 1, |
|
|
|
|
|
|
|
Max: 10, |
|
|
|
|
|
|
|
MinMax: 5, |
|
|
|
|
|
|
|
OmitEmpty: 0, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err := validator.ValidateStruct(tSuccess) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tFail := &TestUint64{ |
|
|
|
|
|
|
|
Required: 0, |
|
|
|
|
|
|
|
Len: 11, |
|
|
|
|
|
|
|
Min: 0, |
|
|
|
|
|
|
|
Max: 11, |
|
|
|
|
|
|
|
MinMax: 0, |
|
|
|
|
|
|
|
OmitEmpty: 11, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = validator.ValidateStruct(tFail) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Top Level
|
|
|
|
|
|
|
|
c.Assert(err.Struct, Equals, "TestUint64") |
|
|
|
|
|
|
|
c.Assert(len(err.Errors), Equals, 6) |
|
|
|
|
|
|
|
c.Assert(len(err.StructErrors), Equals, 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Fields
|
|
|
|
|
|
|
|
AssertFieldError(err, "Required", "required", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Len", "len", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Min", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Max", "max", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "MinMax", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "OmitEmpty", "max", c) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestStructFloat64Validation(c *C) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tSuccess := &TestFloat64{ |
|
|
|
|
|
|
|
Required: 1, |
|
|
|
|
|
|
|
Len: 10, |
|
|
|
|
|
|
|
Min: 1, |
|
|
|
|
|
|
|
Max: 10, |
|
|
|
|
|
|
|
MinMax: 5, |
|
|
|
|
|
|
|
OmitEmpty: 0, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err := validator.ValidateStruct(tSuccess) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tFail := &TestFloat64{ |
|
|
|
|
|
|
|
Required: 0, |
|
|
|
|
|
|
|
Len: 11, |
|
|
|
|
|
|
|
Min: 0, |
|
|
|
|
|
|
|
Max: 11, |
|
|
|
|
|
|
|
MinMax: 0, |
|
|
|
|
|
|
|
OmitEmpty: 11, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = validator.ValidateStruct(tFail) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Top Level
|
|
|
|
|
|
|
|
c.Assert(err.Struct, Equals, "TestFloat64") |
|
|
|
|
|
|
|
c.Assert(len(err.Errors), Equals, 6) |
|
|
|
|
|
|
|
c.Assert(len(err.StructErrors), Equals, 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Fields
|
|
|
|
|
|
|
|
AssertFieldError(err, "Required", "required", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Len", "len", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Min", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Max", "max", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "MinMax", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "OmitEmpty", "max", c) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestStructSliceValidation(c *C) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tSuccess := &TestSlice{ |
|
|
|
|
|
|
|
Required: []int{1}, |
|
|
|
|
|
|
|
Len: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, |
|
|
|
|
|
|
|
Min: []int{1, 2}, |
|
|
|
|
|
|
|
Max: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, |
|
|
|
|
|
|
|
MinMax: []int{1, 2, 3, 4, 5}, |
|
|
|
|
|
|
|
OmitEmpty: []int{}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err := validator.ValidateStruct(tSuccess) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tFail := &TestSlice{ |
|
|
|
|
|
|
|
Required: []int{}, |
|
|
|
|
|
|
|
Len: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1}, |
|
|
|
|
|
|
|
Min: []int{}, |
|
|
|
|
|
|
|
Max: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1}, |
|
|
|
|
|
|
|
MinMax: []int{}, |
|
|
|
|
|
|
|
OmitEmpty: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = validator.ValidateStruct(tFail) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Top Level
|
|
|
|
|
|
|
|
c.Assert(err.Struct, Equals, "TestSlice") |
|
|
|
|
|
|
|
c.Assert(len(err.Errors), Equals, 6) |
|
|
|
|
|
|
|
c.Assert(len(err.StructErrors), Equals, 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert Fields
|
|
|
|
|
|
|
|
AssertFieldError(err, "Required", "required", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Len", "len", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Min", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "Max", "max", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "MinMax", "min", c) |
|
|
|
|
|
|
|
AssertFieldError(err, "OmitEmpty", "max", c) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestInvalidStruct(c *C) { |
|
|
|
|
|
|
|
s := &SubTest{ |
|
|
|
|
|
|
|
Test: "1", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c.Assert(func() { validator.ValidateStruct(s.Test) }, PanicMatches, "interface passed for validation is not a struct") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestInvalidField(c *C) { |
|
|
|
|
|
|
|
s := &SubTest{ |
|
|
|
|
|
|
|
Test: "1", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c.Assert(func() { validator.ValidateFieldByTag(s, "required") }, PanicMatches, "Invalid field passed to ValidateFieldWithTag") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestInvalidTagField(c *C) { |
|
|
|
|
|
|
|
s := &SubTest{ |
|
|
|
|
|
|
|
Test: "1", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c.Assert(func() { validator.ValidateFieldByTag(s.Test, "") }, PanicMatches, fmt.Sprintf("Invalid validation tag on field %s", "")) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (ms *MySuite) TestInvalidValidatorFunction(c *C) { |
|
|
|
|
|
|
|
s := &SubTest{ |
|
|
|
|
|
|
|
Test: "1", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c.Assert(func() { validator.ValidateFieldByTag(s.Test, "zzxxBadFunction") }, PanicMatches, fmt.Sprintf("Undefined validation function on field %s", "")) |
|
|
|
|
|
|
|
} |
|
|
|