chore: coding style (#3413)

This commit is contained in:
Kevin Wan
2023-07-12 01:08:09 +08:00
committed by GitHub
parent b9c0c0f8b5
commit 0c6eaeda9f
2 changed files with 10 additions and 7 deletions

View File

@@ -618,7 +618,7 @@ func (u *Unmarshaler) processFieldPrimitiveWithJSONNumber(fieldType reflect.Type
target.SetFloat(fValue)
default:
return newTypeMismatchErrorWithHint(fullName, value.Type().String(), typeKind.String())
return newTypeMismatchErrorWithHint(fullName, typeKind.String(), value.Type().String())
}
SetValue(fieldType, value, target)
@@ -1054,8 +1054,9 @@ 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 newTypeMismatchErrorWithHint(name, expectType, actualType string) error {
return fmt.Errorf("type mismatch for field %q, expect %q, actual %q",
name, expectType, actualType)
}
func readKeys(key string) []string {