This fixes an issue where if the param of a time.Durtion type is specified
as an integer, denoting nanosecond precision, instead of time duration
string the validation would panic.
the fixes ensures it falls back to the previous expected behaviour.
Fixes Or Enhances https://github.com/go-playground/validator/issues/518.
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.
Change Details:
The datauri validation was not allowing certain valid strings; this
commit updates the regex to meet RFC 2397. I drew heavily on this gist
https://gist.github.com/khanzadimahdi/bab8a3416bdb764b9eda5b38b35735b8,
but had to make a few updates to remove some negative lookaheads (which
Go doesn't allow afaik), and to account for the way the `isDataURI`
function works - it validates the base64 separately from the other parts
of the uri.
@go-playground/admins
Fixes Or Enhances https://github.com/go-playground/validator/issues/525.
**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.
Change Details:
* Adds the ability to match on space separated strings when using the
`oneof` validation. Space separted strings must be surrounded by single
quotes to be validated as one string. For example:
```
oneof='Awaiting Verification' 'Verified' 'Failed Verification'
```
passes validation for a field that is exactly `Failed Verification`
(though just `Failed` would...fail).
@go-playground/admins
`HasPrefix` and `HasSuffix` are both part of the `strings` package.
These seem like generally useful validations to include and cover some
subset of the use-cases of a general regex validator without having any
of the problems outlined by the validator docs.