Split walkPath's four modes into walkers of their own, sharing how a path steps

This commit is contained in:
2026-09-28 00:19:43 +02:00
committed by Lillem4n
parent 9126e0e07d
commit 94eb7aa81f
7 changed files with 261 additions and 187 deletions
+1 -3
View File
@@ -187,9 +187,7 @@ func eachTemplate(root map[string]node, fn func(folder []string, path string, t
}
// resolveCategory walks a dotted path through the folders to the category it
// names, returning that head, the node, and the tail left to read into it. A
// descent of its own rather than a walkPath: it walks folders only and returns
// where they end, not a leaf.
// names, returning that head, the node, and the tail left to read into it.
func resolveCategory(root map[string]node, segments []string) (head []string, target node, tail []string, err error) {
var n node = &folder{children: root}
i := 0