-
Example
type User struct {
Email string ` valid:"matches(^.+\@.+\..+$)"`
Password string `valid:"-"`
}
_, err := govalidator.ValidateStruct(user)
if err != nil {
…
-
Lets say I have a simple struct with a min and max field and I want to make sure that min < max. Does govalidator provide a means to do this?
-
Im trying to valide this struct, my data is a object with 1 object property, this one can have multiple objects with its own propertys, when i send the data, the govalidator respond with an error
…
-
```
type Item struct {
Bt int `valid:"range(1|100)"`
}
func main() {
t := Item{-1}
ok, err := govalidator.ValidateStruct(t)
fmt.Println(ok, err)
}
```
output:Bt: Validator range(1|…
-
e.g. govalidator.CustomTypeTagMessageMap.Set("required", "Can't be blank")
All column tagged as "required", will show "Can't be blank" if invalid.
So you don't need to use `required~Can't be blank` …
-
What do you think about adding custom validators? https://github.com/asaskevich/govalidator has support for this, would be useful for things like ensuring that a parameter is in the value of a map, f…
-
可以加入一些别的类型的上下界判断吗,比如float=1,5,或者能告诉一下别的类型的上下界判断方法是啥么,我看那个readme的第一种没太看懂,测试脚本里也没有这种case
-
Username string `valid:"matches(^[0-9]{3}$)"` success,
Username string `valid:"matches(^[0-9]{3,5}$)"` fail!
error: Username: The following validator is invalid or can't be applied to the field: "…
-
```
{
"pnr": "bddddd",
"quantity": 100,
"flightType": "direct",
"platform": {
"groupWindowOffice": true,
"groupWindowB2B": false,
"serpOffice": true,
…
-
When i use this library to verify if a user it's password is strong enough using the custom type tag it returns the password of that user in the error message.
It would be nice if there is a way to…