This commit is contained in:
@@ -618,7 +618,7 @@ func (u *Unmarshaler) processFieldPrimitiveWithJSONNumber(fieldType reflect.Type
|
||||
|
||||
target.SetFloat(fValue)
|
||||
default:
|
||||
return newTypeMismatchError(fullName)
|
||||
return newTypeMismatchErrorWithHint(fullName, value.Type().String(), typeKind.String())
|
||||
}
|
||||
|
||||
SetValue(fieldType, value, target)
|
||||
@@ -1054,6 +1054,10 @@ func newTypeMismatchError(name string) error {
|
||||
return fmt.Errorf("type mismatch for field %q", name)
|
||||
}
|
||||
|
||||
func newTypeMismatchErrorWithHint(name, errorType, rightType string) error {
|
||||
return fmt.Errorf("type mismatch for field %q, expected %q, got %q", name, rightType, errorType)
|
||||
}
|
||||
|
||||
func readKeys(key string) []string {
|
||||
cacheKeysLock.Lock()
|
||||
keys, ok := cacheKeys[key]
|
||||
|
||||
Reference in New Issue
Block a user