Add additional debugging output on mistyped conversion

This commit is contained in:
Clayton Coleman 2014-10-07 10:50:35 -04:00
parent 0a4d4b43f6
commit 338ee1e458

View File

@ -253,7 +253,7 @@ func (c *Converter) convert(sv, dv reflect.Value, scope *scope) error {
}
if !scope.flags.IsSet(AllowDifferentFieldTypeNames) && c.NameFunc(dt) != c.NameFunc(st) {
return fmt.Errorf("Can't convert %v to %v because type names don't match.", st, dt)
return fmt.Errorf("Can't convert %v to %v because type names don't match (%v, %v).", st, dt, c.NameFunc(st), c.NameFunc(dt))
}
// This should handle all simple types.