E0328: Bad validate: tag
validate: tags are checked on the server before a set or a call runs. The rules are required, omitempty, min=N, max=N, len=N, oneof=a b c and email; a rule taking a number needs one, the others take none. Reported at boot, and by vukavet.
Wrong
vuka
type Filter struct {
Years int `json:"years" validate:"min,max=40"`
Mail string `json:"mail" validate:"mail"`
}go
type Filter struct {
Years int `json:"years" validate:"min,max=40"`
Mail string `json:"mail" validate:"mail"`
}Right
vuka
type Filter struct {
Years int `json:"years" validate:"min=1,max=40"`
Mail string `json:"mail" validate:"email"`
}go
type Filter struct {
Years int `json:"years" validate:"min=1,max=40"`
Mail string `json:"mail" validate:"email"`
}