validator.go 284 B

12345678910111213
  1. package validator
  2. import (
  3. "github.com/go-playground/validator/v10"
  4. )
  5. // New creates a new instance of validator and sets the tag name
  6. // to "form", instead of "validate"
  7. func New() *validator.Validate {
  8. validate := validator.New()
  9. validate.SetTagName("form")
  10. return validate
  11. }