Answer architecture round 9: each data package exports Modules, a locale's importing its country's geo package as a bench chose, and a namespace mounts a tree through an fs.FS wrapper, so internal/datafiles walks file-system folders alone

This commit is contained in:
2026-10-11 15:05:56 +02:00
committed by Lillem4n
parent d4dee46086
commit d242466859
12 changed files with 207 additions and 53 deletions
+8 -2
View File
@@ -1,9 +1,15 @@
// Package misc is fejkdata's locale-neutral module, whose categories are misc.*.
package misc
import "embed"
import (
"embed"
"io/fs"
)
// FS holds the module's categories and its manifest; pass it to fejkdata.WithDataFS.
// FS holds the module's categories and its manifest.
//
//go:embed *.json *.tsv .fejkdata.json
var FS embed.FS
// Modules returns FS, which reads no other module, to pass to fejkdata.WithDataFS.
func Modules() []fs.FS { return []fs.FS{FS} }