15 lines
275 B
Go
Executable File
15 lines
275 B
Go
Executable File
package formvalidators
|
|
|
|
import "github.com/go-playground/validator/v10"
|
|
|
|
type FormValidator struct {
|
|
*validator.Validate
|
|
}
|
|
|
|
func New() (f FormValidator) {
|
|
validate := validator.New()
|
|
validate.RegisterValidation("phoneNumber", PhoneNumber)
|
|
f.Validate = validate
|
|
return
|
|
}
|