[x] I have looked at the documentation here first?
[x] I have looked at the examples provided that may showcase my question here?
Relates to #938
Package version:
v10
Issue, Question or Enhancement:
Validator excluded_unless does not behave as the documentation describes.
The documentation says: "The field under validation must not be present or is empty unless all the other specified fields are equal to the value following with the specified field."
What the validator does: "The field under validation must not be present or is empty if all the other specified fields are equal to the value following with the specified field."
Code sample, to showcase or reproduce:
type Testing struct {
A string
B string `validate:"excluded_unless=A include"`
}
errs = validate.Struct(Testing{A: "include", B: "pass"}) // -> Should pass, but fails
errs = validate.Struct(Testing{A: "exclude", B: "fail"}) // -> Should fail, but passes
Relates to #938
Package version:
v10
Issue, Question or Enhancement:
Validator
excluded_unless
does not behave as the documentation describes. The documentation says: "The field under validation must not be present or is emptyunless
all the other specified fields are equal to the value following with the specified field." What the validator does: "The field under validation must not be present or is emptyif
all the other specified fields are equal to the value following with the specified field."Code sample, to showcase or reproduce: