northwesternmutual / grammes

A Go package built to communicate with Apache TinkerPop™ Graph computing framework using Gremlin; a graph traversal language used by graph databases such as JanusGraph®, MS Cosmos DB, AWS Neptune, and DataStax® Enterprise Graph.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

errors not returned

blackjune opened this issue · comments

@blackjune do you mind explaining your issue? From what I can see the error is being returned.
The loop on response.go#L77 looks fine to me.

for _, d := range dataI.([]interface{}) {
	if dataPart, err = jsonMarshalData(d); err != nil {
		return nil, err // L78: being returned
	}

	data = append(data, dataPart)
}

when d is an error, d will be lost.
when jsonMarshalData returns an error, where will be a memory leak

Hmmm... I see.

Do you mind making a pull request with those changes?