MCPcopy Create free account
hub / github.com/RedisGraph/redisgraph-go / String

Method String

path.go:61–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61func (p Path) String() string {
62 s := []string{"<"}
63 edgeCount := p.EdgeCount()
64 for i := 0; i < edgeCount; i++ {
65 var node = p.GetNode(i)
66 s = append(s, "(" , fmt.Sprintf("%v", node.ID) , ")")
67 var edge = p.GetEdge(i)
68 if node.ID == edge.srcNodeID {
69 s = append(s, "-[" , fmt.Sprintf("%v", edge.ID) , "]->")
70 } else {
71 s= append(s, "<-[" , fmt.Sprintf("%v", edge.ID) , "]-")
72 }
73 }
74 s = append(s, "(" , fmt.Sprintf("%v", p.GetNode(edgeCount).ID) , ")")
75 s = append(s, ">")
76
77 return strings.Join(s, "")
78}

Callers

nothing calls this directly

Calls 3

EdgeCountMethod · 0.95
GetNodeMethod · 0.95
GetEdgeMethod · 0.95

Tested by

no test coverage detected