Skip to content

Commit

Permalink
Added byte slice handling for structs in newNode
Browse files Browse the repository at this point in the history
  • Loading branch information
damienstamates committed Jul 30, 2019
1 parent 289a166 commit 45008ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions newnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func setNewNode(ctx context.Context, txn dgraphTxn, b builder,
if uid, ok := d.Object.(UID); ok {
// Use the UID format instead of the regular object.
fmt.Fprintf(b, rdfReference+d.dataType+rdfEnd, identifier, d.Predicate, uid)
} else if slice, ok := d.Object.([]byte); ok {
// get any optional XML datatype knowledge based on the value.
fmt.Fprintf(b, rdfBase+rdfEnd, identifier, d.Predicate, string(slice))
} else {
// get any optional XML datatype knowledge based on the value.
fmt.Fprintf(b, rdfBase+d.dataType+rdfEnd, identifier, d.Predicate, d.Object)
Expand Down

0 comments on commit 45008ed

Please sign in to comment.