Ship en_US, sv_SE, misc, geo/SE and geo/US as Go packages exporting FS, listed by data.Modules(), and fail a bare New naming WithDataFS

This commit is contained in:
2026-10-10 13:08:01 +02:00
committed by Lillem4n
parent 3368f085fd
commit b8eba1eb35
151 changed files with 377 additions and 232 deletions
+5 -4
View File
@@ -1,10 +1,11 @@
// Package fejkdata generates fake data from recursive JSON templates.
//
// Data lives in JSON, not in Go. A generator starts from the shipped data set and
// layers any directories you add; folders and files become a dot-path namespace,
// then generate values by path:
// Data lives in JSON, not in Go, and comes in modules: a Go package exporting an fs.FS,
// or a folder. A generator loads the modules you name, such as every one fejkdata ships
// from the package github.com/larvit/fejkdata/data; folders and files become a dot-path
// namespace, then generate values by path:
//
// f, _ := fejkdata.New(fejkdata.WithSeed(42))
// f, _ := fejkdata.New(fejkdata.WithDataFS(data.Modules()...), fejkdata.WithSeed(42))
// f.Fake("sv_SE.address") // "Räfsalsvägen 43\n442 42 Kungälv"
// f.Fake("sv_SE.address.locality") // "Umeå": a second call draws afresh
//