Open danjacques opened 8 years ago
the current behavior (panic) is to try to ensure an issue like in your example is caught in dev or testing, and not production.
but +1 your proposed enhancement sounds good to me. if you can send a PR, I'd be grateful.
In
validateField
,reflect.Value
'sSet
method is called on a type to install its default value. If the target field is a custom type, this will panic with a type mismatch inreflect
.Minimally, this should error instead of panic. Ideally, it would check Kind and use
SetString
or equivalent instead of rawSet
.