ozzo-validation icon indicating copy to clipboard operation
ozzo-validation copied to clipboard

support errors.Is on validation.Errors ?

Open titouanfreville opened this issue 5 years ago • 2 comments

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.

titouanfreville avatar Jun 12 '20 13:06 titouanfreville

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

bokunodev avatar Aug 25 '22 04:08 bokunodev

any update on this issue?

mrsoftware avatar Nov 06 '22 15:11 mrsoftware