Skip to content

Commit 5dc5df2

Browse files
committed
addressed comments
1 parent 9e32c77 commit 5dc5df2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

request.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
469469
// this indicates disassociating the relationship
470470
isExplicitNull = true
471471
} else if relationshipDecodeErr != nil {
472-
fmt.Printf("decode err %v\n", relationshipDecodeErr)
472+
er = fmt.Errorf("decode err %v\n", relationshipDecodeErr)
473473
}
474474

475475
// This will hold either the value of the choice type model or the actual
@@ -493,11 +493,11 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
493493
if relationship.Data == nil {
494494

495495
// Explicit null supplied for the field value
496-
// If a nullable relationship we set the
497-
if isExplicitNull && strings.HasPrefix(fieldType.Type.Name(), "NullableRelationship[") {
498-
fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1))
499-
fieldValue.SetMapIndex(reflect.ValueOf(false), m)
500-
}
496+
// If a nullable relationship we set the field value to a map with a single entry
497+
if isExplicitNull {
498+
fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1))
499+
fieldValue.SetMapIndex(reflect.ValueOf(false), m)
500+
}
501501

502502
continue
503503
}

0 commit comments

Comments
 (0)