|
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
|
|
}
|