Validate validates the configuration of the validator object.
()
| 707 | |
| 708 | // Validate validates the configuration of the validator object. |
| 709 | func (v *Validator) Validate() error { |
| 710 | if v == nil { |
| 711 | return errors.New("invalid validator: nil") |
| 712 | } |
| 713 | if v.Name == "" { |
| 714 | return errors.New("invalid validator: missing name") |
| 715 | } |
| 716 | return nil |
| 717 | } |
| 718 | |
| 719 | // SetConfig sets the set of map key-value pairs associated with this validator's configuration. |
| 720 | func (v *Validator) SetConfig(config map[string]any) *Validator { |