parcoursmob/utils/form-validators/form-validators.go

15 lines
275 B
Go
Raw Permalink Normal View History

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
}