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/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.
It was originally intended for these to only be used on strings, however
it makes sense to also use them if your dealing with type interface{}
so now ints and floats return true for this validation also as they are
both numeric and numbers.
closes#356