go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.53k stars 1.31k forks source link

Custom validation seems to be never overridden. #1070

Open mshaposhnik opened 1 year ago

mshaposhnik commented 1 year ago

Package version eg. v9, v10:

v10

Issue, Question or Enhancement:

Custom validation seems to be never overridden.

I want my custom validation to be switchable on/off. So i decided to register my custom tag either with a "real" checking method, or "dummy" one which is always just returns true. But it seemed, after first registration, it always using that first registered method, ignoring tries to re-register it into another one.

Can we have something like Reset() to cleanup registered custom validation or aliases?

Code sample, to showcase or reproduce:

playground