From 45008ed5900f7b96896b7373b19c2427c12d7db4 Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 30 Jul 2019 16:28:36 -0500 Subject: [PATCH] Added byte slice handling for structs in newNode --- newnode.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/newnode.go b/newnode.go index 5cb585e..5241cb8 100644 --- a/newnode.go +++ b/newnode.go @@ -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)