go-playground / validator

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

feat: add required_if_contains, excluded_unless_contains and excluded_if_contains #1257

Open lucasoares opened 2 months ago

lucasoares commented 2 months ago

Fixes Or Enhances

1256

I didn't have too much time to check the current codebase to make sure my implementation fits the current contribution guidelines because I implemented this for a specific use case I had. I'm using it without issues for now...

I didn't like the function renaming I did to add a new parameter but I haven't thought of a better name and wanted to make sure it is compatible with previous implementations.

I haven't added translation for this tag, I have no idea how to do it and out of time right now, sorry

Make sure that you've checked the boxes below before you submit PR:

@go-playground/validator-maintainers

coveralls commented 2 months ago

Coverage Status

coverage: 74.259% (+0.05%) from 74.208% when pulling fda6e97e7e9c30d678008eddefeeefc2656ac113 on lucasoares:feat/contains into a0f74b0fb2a7ae1750c0f0b0a49550d8b6e2e708 on go-playground:master.