Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 25 19:53
    yhrn commented #384
  • Feb 21 18:12
  • Feb 21 16:18
    elipavlov commented #437
  • Feb 21 16:16
    elipavlov commented #437
  • Feb 21 16:14
    elipavlov ready_for_review #437
  • Feb 21 16:09
    elipavlov synchronize #437
  • Feb 21 15:48
    elipavlov synchronize #437
  • Feb 21 14:27
    elipavlov synchronize #437
  • Feb 21 10:13
    elipavlov converted_to_draft #437
  • Feb 20 12:19
    migueleliasweb commented #384
  • Feb 20 10:31
    yhrn commented #384
  • Feb 19 20:01
    xmlking commented #384
  • Feb 19 19:55
    xmlking commented #384
  • Feb 19 09:23
    yhrn commented #384
  • Feb 19 09:20
    yhrn commented #384
  • Feb 18 07:30
    thuliu-yt16 closed #342
  • Feb 18 07:30
    thuliu-yt16 commented #342
  • Feb 17 18:42
    Ramnmo commented #342
  • Feb 16 22:24
    elipavlov synchronize #437
  • Feb 16 22:17
    elipavlov opened #437
Jeffery Utter
@jeffutter
Hello. Anyone have any advice on how to validate a user struct with "password" and "encrypted_password" so that the password validation only runs if the encrypted one is set?
Markus Mahlberg
@mwmahlberg
I think it does not work that way. The "problem" is that fields are validated independently. So even when you use the tagMap, synchronization would be pretty tricky. Furthermore, my thinking is that this is business logic and should belong to the handler(Func)/controller/service or however you have organized your application.
Kareem H
@magicalbanana
How do you access multiple validation errors?
vanthinh
@thinhlvv
Are you guys using Go also ? Just have 1 idea to validate encrypted_password that about the length
Markus Mahlberg
@mwmahlberg
vanth
@LeVuVanThinh Why don't you validate the password the "old" way: on entering and again before you hash it (I sincerely hope you do not encrypt it).
sahil chug
@twistedlog
is there any way to customise error messages using govalidator lib?
Markus Mahlberg
@mwmahlberg
@twistedlog asaskevich/govalidator#121
Markus Mahlberg
@mwmahlberg
@twistedlog Basically, you use a tilde after the validator in the struct tag: valid:"required~Your custom error message on zero value,length(4|10)~Your custom error message for length constraint violation"
sahil chug
@twistedlog
Thanks.
kk
@talmr-k
hi
Josh Reese
@joshlreese
Howdy - I was wondering since it's been just about two months since the fix for #266 was added if a v10 release is in the works?
Brian Henderson
@bhenderson
hi all, is there a way to validate that a slice is to be non empty?
Brian Henderson
@bhenderson
looks like "required" already takes care of it!
Adrian Brad
@adrianbrad
hello, is it possible to validate a struct field against another field from the same struct?