update readme for adding binding about skip validate

This commit is contained in:
thinkerou 2018-05-17 19:59:29 +08:00
parent 5636afe02d
commit 7f3d687387

View File

@ -571,6 +571,9 @@ $ curl -v -X POST \
{"error":"Key: 'Login.Password' Error:Field validation for 'Password' failed on the 'required' tag"} {"error":"Key: 'Login.Password' Error:Field validation for 'Password' failed on the 'required' tag"}
``` ```
**Skip validate**
When running the above example using the above the `curl` command, it returns error. Because the example use `binding:"required"` for `Password`. If use `binding:"-"` for `Password`, then it will not return error when running the above example again.
### Custom Validators ### Custom Validators
It is also possible to register custom validators. See the [example code](examples/custom-validation/server.go). It is also possible to register custom validators. See the [example code](examples/custom-validation/server.go).