(p string)
| 293 | } |
| 294 | |
| 295 | func (t *TreeNode) createNodeDeep(p string) *TreeNode { |
| 296 | crtParent := t |
| 297 | split := strings.Split(p, "/") |
| 298 | for i := range split { |
| 299 | childPath := strings.Join(split[:i+1], "/") |
| 300 | if c, o := crtParent.children[childPath]; o { |
| 301 | crtParent = c |
| 302 | } else { |
| 303 | n := NewTreeNode(tree.LightNode(tree.NodeType_UNKNOWN, "", childPath, "", 0, 0, 0)) |
| 304 | crtParent.AddChild(n) |
| 305 | crtParent = n |
| 306 | } |
| 307 | } |
| 308 | return crtParent |
| 309 | } |
| 310 | |
| 311 | func (t *TreeNode) Walk(cb func(n *TreeNode) bool) { |
| 312 | if pruneBranch := cb(t); pruneBranch { |
no test coverage detected