You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have looked at the examples provided that may showcase my question here?
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
The package docs mentioned that time.Duration are supported for some validations e.g. min, max, eq, etc.
However the translations code (at least the EN one) fails when time.Duration validation error occurs.
It happens because the translation assumes the value to be convertible to number (float), as seen in code below:
## Fixes Or Enhances
This PR adds `time.Duration` translation and unit test cases.
Connected to: #1069
**Make sure that you've checked the boxes below before you submit PR:**
- [x] Tests exist or have been written that cover this particular
change.
@go-playground/validator-maintainers
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
The package docs mentioned that time.Duration are supported for some validations e.g. min, max, eq, etc.
However the translations code (at least the EN one) fails when time.Duration validation error occurs.
It happens because the translation assumes the value to be convertible to number (float), as seen in code below:
validator/translations/en/en.go
Line 167 in 3201fe4
Code sample, to showcase or reproduce:
https://go.dev/play/p/E2e5iYMb2BC
The text was updated successfully, but these errors were encountered: