asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6k stars 556 forks source link

validation for negative values on range validator. #441

Open joicemjoseph opened 3 years ago

joicemjoseph commented 3 years ago

Feature Request

While validating negative integer values using range tag with ValidateStruct(), I received the following error message. The following validator is invalid or can't be applied to the field: \"range(-1|50000)\"

I request to add support for -ve integer values for range tag.

Q A
New Feature yes
RFC no
BC Break no

Summary

If this feature is added, then we could validate -ve integer values. the validation tag range(-1|50000) would work as expected.

If you can agree, I could work on it.

sergeyglazyrindev commented 2 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.