(parent *templates.FileTree, name, path string)
| 306 | } |
| 307 | |
| 308 | func findOrCreateDir(parent *templates.FileTree, name, path string) *templates.FileTree { |
| 309 | for _, ch := range parent.Children { |
| 310 | if ch.IsDir && ch.Name == name { |
| 311 | return ch |
| 312 | } |
| 313 | } |
| 314 | node := &templates.FileTree{IsDir: true, Name: name, Path: path} |
| 315 | parent.Children = append(parent.Children, node) |
| 316 | return node |
| 317 | } |
| 318 | |
| 319 | func sortNode(n *templates.FileTree) { |
| 320 | if len(n.Children) == 0 { |