Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 87c6b8e

Browse files
CrushedPixelshwoodard
authored andcommitted
Fixed format types
1 parent ccac636 commit 87c6b8e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

request.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
254254
}
255255

256256
// As a final catch-all, ensure types line up to avoid a runtime panic.
257-
if fieldValue.Kind() != v.Kind() {
257+
if fieldValue.Kind() != value.Kind() {
258258
return ErrInvalidType
259259
}
260-
assignValue(fieldValue, reflect.ValueOf(val))
260+
assignValue(fieldValue, value)
261261
} else if annotation == annotationRelation {
262262
isSlice := fieldValue.Type().Kind() == reflect.Slice
263263

request_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,17 +799,17 @@ func TestUnmarshalCustomTypeAttributes(t *testing.T) {
799799
}
800800

801801
if expected, actual := customInt, customAttributeTypes.Int; expected != actual {
802-
t.Fatalf("Was expecting custom int to be `%s`, got `%s`", expected, actual)
802+
t.Fatalf("Was expecting custom int to be `%d`, got `%d`", expected, actual)
803803
}
804804
if expected, actual := customInt, *customAttributeTypes.IntPtr; expected != actual {
805-
t.Fatalf("Was expecting custom int pointer to be `%s`, got `%s`", expected, actual)
805+
t.Fatalf("Was expecting custom int pointer to be `%d`, got `%d`", expected, actual)
806806
}
807807
if customAttributeTypes.IntPtrNull != nil {
808-
t.Fatalf("Was expecting custom int pointer to be <nil>, got `%s`", customAttributeTypes.IntPtrNull)
808+
t.Fatalf("Was expecting custom int pointer to be <nil>, got `%d`", customAttributeTypes.IntPtrNull)
809809
}
810810

811811
if expected, actual := customFloat, customAttributeTypes.Float; expected != actual {
812-
t.Fatalf("Was expecting custom float to be `%s`, got `%s`", expected, actual)
812+
t.Fatalf("Was expecting custom float to be `%f`, got `%f`", expected, actual)
813813
}
814814
if expected, actual := customString, customAttributeTypes.String; expected != actual {
815815
t.Fatalf("Was expecting custom string to be `%s`, got `%s`", expected, actual)

0 commit comments

Comments
 (0)