MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / getParents

Function getParents

module/catalogue/tree.go:85–103  ·  view source on GitHub ↗
(parentID string, nodeMap map[string]*Group, parentMap map[string][]string)

Source from the content-addressed store, hash-verified

83}
84
85func getParents(parentID string, nodeMap map[string]*Group, parentMap map[string][]string) []string {
86 if parentID == "" {
87 return nil
88 }
89 if parents, has := parentMap[parentID]; has {
90 return parents
91 }
92 parents := make([]string, 0)
93 node, has := nodeMap[parentID]
94 if !has {
95 return nil
96 }
97 parents = append(parents, parentID)
98 tmp := getParents(node.Parent, nodeMap, parentMap)
99 if tmp != nil {
100 parents = append(parents, tmp...)
101 }
102 return parents
103}
104
105func (g *Group) ResetDepth(d int) {
106 g.Depth = d

Callers 1

NewRootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected