|
|
@ -7,6 +7,14 @@ and has the ability to dive into arrays and maps of any type. |
|
|
|
|
|
|
|
|
|
|
|
see more examples https://github.com/go-playground/validator/tree/master/_examples
|
|
|
|
see more examples https://github.com/go-playground/validator/tree/master/_examples
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Singleton |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Validator is designed to be thread-safe and used as a singleton instance. |
|
|
|
|
|
|
|
It caches information about your struct and validations, |
|
|
|
|
|
|
|
in essence only parsing your validation tags once per struct type. |
|
|
|
|
|
|
|
Using multiple instances neglects the benefit of caching. |
|
|
|
|
|
|
|
The not thread-safe functions are explicitly marked as such in the documentation. |
|
|
|
|
|
|
|
|
|
|
|
Validation Functions Return Type error |
|
|
|
Validation Functions Return Type error |
|
|
|
|
|
|
|
|
|
|
|
Doing things this way is actually the way the standard library does, see the |
|
|
|
Doing things this way is actually the way the standard library does, see the |
|
|
|