The programable validator.
Existing validator is not fully flexible. We want to customize error object generation. We want to modify value instead of raise error when validation failed. We want it.
see usage
v := golidator.NewValidator()
err := v.Validate(obj)
v := golidator.NewValidator()
v.SetValidationFunc("req", func(param string, val reflect.Value) (golidator.ValidationResult, error) {
if str := val.String(); str == "" {
return golidator.ValidationNG, nil
}
return golidator.ValidationOK, nil
})