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

Add the "When" rule #96

Closed mehran-prs closed 4 years ago

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 3f0763add5ff4926c656c8665054f0de1e857679 on mehran-prs:master into e04d503a8535b638143c35c045d29a70b11c1142 on go-ozzo:master.

mehran-prs commented 4 years ago

You're very welcome!

NathanBaulch commented 3 years ago

Should WhenRule implement RuleWithContext just in case any of the rules or elseRules require context? Same with EachRule.

qiangxue commented 3 years ago

Yes, I think this will be a good enhancement. Created a ticket for this: https://github.com/go-ozzo/ozzo-validation/issues/129