1
0
mirror of https://github.com/mgechev/revive.git synced 2025-10-30 23:37:49 +02:00

fix: rule struct-tag false positive on validate:omitempty (#1525)

This commit is contained in:
chavacava
2025-09-20 12:16:31 +02:00
committed by GitHub
parent ec8439e646
commit 8be7fa65f0
2 changed files with 2 additions and 0 deletions

View File

@@ -843,6 +843,7 @@ var validateSingleOptions = map[string]struct{}{
"multibyte": {},
"number": {},
"numeric": {},
"omitempty": {},
"port": {},
"postcode_iso3166_alpha2": {},
"postcode_iso3166_alpha2_field": {},

View File

@@ -156,6 +156,7 @@ type MapStruct struct {
}
type ValidateUser struct {
Id string `validate:"omitempty,min=3,max=32"`
Username string `validate:"required,min=3,max=32"`
Email string `validate:"required,email"`
Password string `validate:"required,min=8,max=32"`