I am a bit surprised with your Go samples in GitHub - dgraph-io/dgo: Official Dgraph Go client
I mean, fancy tree-like JSON is a strange choice for graph representation. I would rather expect to see a []*api.NQuad in your samples which is simply a better match for the task.
I tried to do something myself but this doesn’t work as expected. Could do you provide a small example of equivalent Go code to your set { … }, may be just with the first SW?
We use N-Quad mutations quite often with dgo. I’m not sure what issue you ran into, so it’d be great to understand what issue you faced so we can address it.