govalidator icon indicating copy to clipboard operation
govalidator copied to clipboard

[Go] Package of validators and sanitizers for strings, numerics, slices and structs

Results 127 govalidator issues
Sort by recently updated
recently updated
newest added

I'm trying to add a custom error message for the field length, but for some reason govalidator is not recognising it and always replacing it with the default message. The...

Is there a validator implemented that could validate a phone number by also recognizing the country code? e.g.: `+39(country code) 79435680(phone number)`

`package main import ( "fmt" "github.com/asaskevich/govalidator" ) func main() { url := "http://xn--41a.xn----8sbivjiocsggj.xn--p1ai/jxoka" domain := "xn--41a.xn----8sbivjiocsggj.xn--p1ai" fmt.Println(govalidator.IsURL(url)) fmt.Println(govalidator.IsURL(domain)) } ` output is : false false

``` ./github.com/asaskevich/govalidator/utils.go:156:21: regexpMust: for const patterns like `[ &_=+:]`, use regexp.MustCompile ./github.com/asaskevich/govalidator/utils.go:160:16: regexpMust: for const patterns like `[^[:alnum:]-.]`, use regexp.MustCompile ``` https://github.com/asaskevich/govalidator/blob/f9ffefc3facfbe0caee3fea233cbb6e8208f4541/utils.go#L156-L159 Since the pattern is constant, one might want...

what should do if my custom errormessage contain "~"

The current uuid validation functions accepts string type but the UUID should be 128 bit(16 byte) as defined in [RFC 4122](https://tools.ietf.org/html/rfc4122). I have tried to implement a custom validator to...

Now it only covers gmail.com and googlemail.com. Maybe refactor it as a separate thing from general email normalization and make it possible to pass in a slice or map[string]bool of...

If you validate a struct with nested struct, error reported is wrong is only struct are json tagged. It seems that Error Path don't lookup for json tag. The ouput...