@@ -19,10 +19,10 @@ func PathNew(nodes []interface{}, edges []interface{}) Path {
19
19
for i := 0 ; i < len (edges ); i ++ {
20
20
Edges [i ] = edges [i ].(* Edge )
21
21
}
22
-
23
- return Path {
24
- Edges : Edges ,
25
- Nodes : Nodes ,
22
+
23
+ return Path {
24
+ Edges : Edges ,
25
+ Nodes : Nodes ,
26
26
}
27
27
}
28
28
@@ -38,7 +38,7 @@ func (p Path) GetNode(index int) *Node {
38
38
return p .Nodes [index ]
39
39
}
40
40
41
- func (p Path ) GetEdge (index int ) * Edge {
41
+ func (p Path ) GetEdge (index int ) * Edge {
42
42
return p .Edges [index ]
43
43
}
44
44
@@ -63,16 +63,15 @@ func (p Path) String() string {
63
63
edgeCount := p .EdgeCount ()
64
64
for i := 0 ; i < edgeCount ; i ++ {
65
65
var node = p .GetNode (i )
66
- s = append (s , "(" , fmt .Sprintf ("%v" , node .ID ) , ")" )
66
+ s = append (s , "(" , fmt .Sprintf ("%v" , node .ID ), ")" )
67
67
var edge = p .GetEdge (i )
68
68
if node .ID == edge .srcNodeID {
69
- s = append (s , "-[" , fmt .Sprintf ("%v" , edge .ID ) , "]->" )
69
+ s = append (s , "-[" , fmt .Sprintf ("%v" , edge .ID ), "]->" )
70
70
} else {
71
- s = append (s , "<-[" , fmt .Sprintf ("%v" , edge .ID ) , "]-" )
71
+ s = append (s , "<-[" , fmt .Sprintf ("%v" , edge .ID ), "]-" )
72
72
}
73
73
}
74
- s = append (s , "(" , fmt .Sprintf ("%v" , p .GetNode (edgeCount ).ID ) , ")" )
75
- s = append (s , ">" )
74
+ s = append (s , "(" , fmt .Sprintf ("%v" , p .GetNode (edgeCount ).ID ), ")" , ">" )
76
75
77
76
return strings .Join (s , "" )
78
77
}
0 commit comments