Skip to content

Commit 4cd2eb4

Browse files
Lars Maierneunhoef
authored andcommitted
Do not recurse into non struct types. (#187)
1 parent b14f414 commit 4cd2eb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http/response_json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func decodeObjectFields(objValue reflect.Value, body map[string]*json.RawMessage
158158
objValueType := objValue.Type()
159159
for i := 0; i != objValue.NumField(); i++ {
160160
f := objValueType.Field(i)
161-
if f.Anonymous {
161+
if f.Anonymous && f.Type.Kind() == reflect.Struct {
162162
// Recurse into fields of anonymous field
163163
if err := decodeObjectFields(objValue.Field(i), body); err != nil {
164164
return driver.WithStack(err)

0 commit comments

Comments
 (0)