Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
I am trying to mock ValidationErrors and I've got a panic in the errors.go::Error() function in the cast of ve[i] to *fieldError.
So, to mock ValidationErrors we need to use the interface instead.
Code sample, to showcase or reproduce:
I created a mocked implementation for FieldError.
type MockFieldError struct {
validator.FieldError
ns string
}
func (fe *MockFieldError) Namespace() string {
return fe.ns
}
func (fe *MockFieldError) Error() string {
return "dummyError"
}
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
I am trying to mock
ValidationErrorsand I've got a panic in theerrors.go::Error()function in the cast ofve[i]to*fieldError.So, to mock
ValidationErrorswe need to use the interface instead.Code sample, to showcase or reproduce:
I created a mocked implementation for
FieldError.