govalidator
govalidator copied to clipboard
Error should be thrown if a struct tag is not found
After some debugging I discovered a misspelling of a Govalidator struct tag in my code, i.e.
type Person struct {
Name string `valid:"aalpha"`
}
bob := Person{
Name: "1nv4lid",
}
Running ValidateStruct
on this struct reports no errors, although the tag aalpha
does not map to a validator function.
I believe Govalidator should report an error in this case as per the principle of least surprise; it should be obvious to the Govalidator package that the tag name is incorrect if it's not found.
Looks like this was fixed by 755af07baba135f1ec2678ad646ecb1d93a1096d
@asaskevich issue can be closed 😉
Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.