-
Notifications
You must be signed in to change notification settings - Fork 35
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
refactor(*): add iso8601duration validate tag #78
refactor(*): add iso8601duration validate tag #78
Conversation
The #76 should be merge before, it will fix |
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.
NIce!
Can you rebase to clear the error in the white sec bot?
@@ -94,7 +101,7 @@ func TestRetryStructLevelValidation(t *testing.T) { | |||
Increment: "PT5S", | |||
Jitter: floatstr.FromString("P5S"), | |||
}, | |||
err: `Key: 'Retry.Jitter' Error:Field validation for 'Jitter' failed on the 'reqiso8601duration' tag`, | |||
err: `Key: 'Retry.Jitter' Error:Field validation for 'Jitter' failed on the 'iso8601duration' tag`, |
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.
this message is coming from the validateFunc, right?
Do you think we can make this message easier to understand?
Something like "field is not iso8601duration"
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.
Yes, we should custom the error message to have more description, and this should be done later. For how to implement custom error message, maybe go-playground/validator#559 will helpful.
Signed-off-by: lsytj0413 <511121939@qq.com>
@ricardozanini |
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.
Pretty cool!
Signed-off-by: lsytj0413 511121939@qq.com
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
Special notes for reviewers:
Additional information (if needed):