go-ozzo / ozzo-validation

An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
MIT License
3.73k stars 224 forks source link

support errors.Is on validation.Errors ? #116

Open titouanfreville opened 4 years ago

titouanfreville commented 4 years ago

Hello, While trying to check a validation.Errors stack, I would have liked to make an expected stack then compare it to actual state through an errors.Is comparison on the stack. That is currently impossible as errors.Is by default will assert that pointers object are exactly the same. Would it be acceptable to add an Is implementation witch will assert that for each fields present, the error is the expected one ? I don't think it is that use full outside of testing though but there could be some reason to introspect errors stack on the fly in some code I guess.

bokunodev commented 2 years ago

one addition, make validation.Errors map to implement validation.Error interface would be great.

mrsoftware commented 1 year ago

any update on this issue?