Answer architecture round 3, stability round 1 and product-owner round 1: CalcName and proven.OfCalc for one meaning per name, a lazy load placed where its lookup found it, DataType's constants typed under it, and cover printing the module's total

This commit is contained in:
2026-10-05 15:53:56 +02:00
committed by Lillem4n
parent 679bd43c7c
commit 4f484cd780
11 changed files with 34 additions and 33 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ func loadData(sources []datafiles.Source) (map[string]node, error) {
root := map[string]node{}
for _, src := range sources {
g := &folder{children: map[string]node{}}
if err := src.Walk(compileInto(g)); err != nil {
if err := src.Walk(compileInto(func(dir []string) *folder { return madeFolder(g, dir) })); err != nil {
return nil, err
}
mergeChildren(root, g.children)
@@ -25,14 +25,14 @@ func loadData(sources []datafiles.Source) (map[string]node, error) {
return root, nil
}
// compileInto compiles each category it is handed into its folder under root.
func compileInto(root *folder) func(datafiles.Category) error {
// compileInto compiles each category it is handed into the folder place finds for its dir.
func compileInto(place func(dir []string) *folder) func(datafiles.Category) error {
return func(c datafiles.Category) error {
n, err := compileCategory(c.JSON, c.Name, c.ReadRows)
if err != nil {
return err
}
madeFolder(root, c.Dir).children[c.Name] = n
place(c.Dir).children[c.Name] = n
return nil
}
}