@@ -27,7 +27,7 @@ type Graph struct {
27
27
28
28
// New creates a new graph.
29
29
func GraphNew (Id string , conn redis.Conn ) Graph {
30
- g := Graph {
30
+ return Graph {
31
31
Id : Id ,
32
32
Nodes : make (map [string ]* Node , 0 ),
33
33
Edges : make ([]* Edge , 0 ),
@@ -36,7 +36,6 @@ func GraphNew(Id string, conn redis.Conn) Graph {
36
36
relationshipTypes : make ([]string , 0 ),
37
37
properties : make ([]string , 0 ),
38
38
}
39
- return g
40
39
}
41
40
42
41
// AddNode adds a node to the graph.
@@ -205,7 +204,7 @@ func (g *Graph) getLabel(lblIdx int) string {
205
204
// Retry.
206
205
if lblIdx >= len (g .labels ) {
207
206
// Error!
208
- panic ("Unknow label index." )
207
+ panic ("Unknown label index." )
209
208
}
210
209
}
211
210
g .mutex .Unlock ()
@@ -225,7 +224,7 @@ func (g *Graph) getRelation(relIdx int) string {
225
224
// Retry.
226
225
if relIdx >= len (g .relationshipTypes ) {
227
226
// Error!
228
- panic ("Unknow relation type index." )
227
+ panic ("Unknown relation type index." )
229
228
}
230
229
}
231
230
g .mutex .Unlock ()
@@ -246,7 +245,7 @@ func (g *Graph) getProperty(propIdx int) string {
246
245
// Retry.
247
246
if propIdx >= len (g .properties ) {
248
247
// Error!
249
- panic ("Unknow property index." )
248
+ panic ("Unknown property index." )
250
249
}
251
250
}
252
251
g .mutex .Unlock ()
0 commit comments