Skip to content

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"`
}
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"`
}

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.