15 lines
275 B
Go
15 lines
275 B
Go
|
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
|
||
|
}
|