You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: validator.go
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
// Package validation is basically a wrapper around https://github.com/go-playground/validator and https://github.com/go-playground/mold.
2
+
//
3
+
// Besides the functionality of the go-playground packages it supports a more flexible error translation by using struct tags for error messages.
4
+
//
5
+
// The error message is set into the `errors` tag of the struct field, the key is the validator as provided in the `validate`
6
+
// struct tag. Multiple validators/errors are supported.
1
7
package validation
2
8
3
9
import (
@@ -20,6 +26,7 @@ type Validator struct {
20
26
21
27
varregexIndex=regexp.MustCompile(`(\[(\d+)])$`)
22
28
29
+
// NewValidator initializes and returns a new Validator instance with default configurations and custom validations.
0 commit comments