-
Notifications
You must be signed in to change notification settings - Fork 1.4k
use mail.ParseAddress to cover missing email validations #1395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tions
errs = validate.Var(s, "email") | ||
NotEqual(t, errs, nil) | ||
AssertError(t, errs, "", "", "", "", "email") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's include one more test case.
s = "Foo Bar <foobar@example.com>"
errs = validate.Var(s, "email")
NotEqual(t, errs, nil)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, added this test as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This seems more robust, no problem with merging this |
Thanks mates, waiting for the merge, I want to clean the temp hack (override of the default email validate) from my code (: |
Fixes Or Enhances
Make sure that you've checked the boxes below before you submit PR:
@go-playground/validator-maintainers