Skip to content

Commit d223574

Browse files
authored
Merge pull request #57 from RedisGraph/mutex-passed-by-value
Fix mutex passed by value warning
2 parents e6fc6a6 + 62406fe commit d223574

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

graph.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Graph struct {
2727

2828
// New creates a new graph.
2929
func GraphNew(Id string, conn redis.Conn) Graph {
30-
g := Graph{
30+
return Graph{
3131
Id: Id,
3232
Nodes: make(map[string]*Node, 0),
3333
Edges: make([]*Edge, 0),
@@ -36,7 +36,6 @@ func GraphNew(Id string, conn redis.Conn) Graph {
3636
relationshipTypes: make([]string, 0),
3737
properties: make([]string, 0),
3838
}
39-
return g
4039
}
4140

4241
// AddNode adds a node to the graph.
@@ -205,7 +204,7 @@ func (g *Graph) getLabel(lblIdx int) string {
205204
// Retry.
206205
if lblIdx >= len(g.labels) {
207206
// Error!
208-
panic("Unknow label index.")
207+
panic("Unknown label index.")
209208
}
210209
}
211210
g.mutex.Unlock()
@@ -225,7 +224,7 @@ func (g *Graph) getRelation(relIdx int) string {
225224
// Retry.
226225
if relIdx >= len(g.relationshipTypes) {
227226
// Error!
228-
panic("Unknow relation type index.")
227+
panic("Unknown relation type index.")
229228
}
230229
}
231230
g.mutex.Unlock()
@@ -246,7 +245,7 @@ func (g *Graph) getProperty(propIdx int) string {
246245
// Retry.
247246
if propIdx >= len(g.properties) {
248247
// Error!
249-
panic("Unknow property index.")
248+
panic("Unknown property index.")
250249
}
251250
}
252251
g.mutex.Unlock()

0 commit comments

Comments
 (0)