Move the folder walk and the reading of a data tree's JSON and TSV files into internal/datafiles

This commit is contained in:
2026-10-05 15:32:39 +02:00
committed by Lillem4n
parent 691f304096
commit 818a9b56c2
7 changed files with 218 additions and 169 deletions
+2 -2
View File
@@ -119,10 +119,10 @@ func compile(v any) (node, error) {
// compileCategory compiles a data file's value, which may be a table over a rows
// file beside it, and refuses a choice that is a table written as templates.
func compileCategory(v any, name string, files *categoryFiles) (node, error) {
func compileCategory(v any, name string, readRows func(file string) (string, error)) (node, error) {
if m, ok := v.(map[string]any); ok {
if _, isTable := m["rows"]; isTable {
return compileTable(m, name, files)
return compileTable(m, name, readRows)
}
}
if items, ok := v.([]any); ok {