File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -5,21 +5,7 @@ based on tags.
55It can also handle Cross-Field and Cross-Struct validation for nested structs
66and has the ability to dive into arrays and maps of any type.
77
8- Why not a better error message?
9- Because this library intends for you to handle your own error messages.
10-
11- Why should I handle my own errors?
12- Many reasons. We built an internationalized application and needed to know the
13- field, and what validation failed so we could provide a localized error.
14-
15- if fieldErr.Field() == "Name" {
16- switch fieldErr.Tag()
17- case "required":
18- return "Translated string based on field + error"
19- default:
20- return "Translated string based on field"
21- }
22-
8+ see more examples https://github.com/go-playground/validator/tree/v9/examples
239
2410Validation Functions Return Type error
2511
You can’t perform that action at this time.
0 commit comments