asaskevich / govalidator

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

It is possible to set custom message for one kind validation? #139

Open binku87 opened 8 years ago

binku87 commented 8 years ago

e.g. govalidator.CustomTypeTagMessageMap.Set("required", "Can't be blank")

All column tagged as "required", will show "Can't be blank" if invalid.

So you don't need to use required~Can't be blank anywhere.

waltton commented 8 years ago

Take a look at #121

binku87 commented 8 years ago

Take a look at #121

I known this. But using this way you need to write required~Can't be blank multipart times, right?

I need a way to custom on global. such as govalidator.CustomTypeTagMessageMap.Set("required", "Can't be blank").

sergeyglazyrindev commented 3 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.