diff --git a/fejkdata.go b/fejkdata.go index c47e10e..7999c23 100644 --- a/fejkdata.go +++ b/fejkdata.go @@ -34,8 +34,7 @@ type Generator struct { mu sync.Mutex rand *session categories map[string]node - root folder // the categories as the node a path walks from, owned here so a walk allocates none - set holdSet // one Fake's hold set, owned here so a walk pinning rows keeps them off the heap + root folder // the categories as the node a path walks from, owned here so a walk allocates none records map[node]recordShape structs map[reflect.Type]structResult } diff --git a/render.go b/render.go index b3b776c..b6490d6 100644 --- a/render.go +++ b/render.go @@ -23,8 +23,8 @@ func (f *Generator) Fake(path string) (string, error) { if err != nil { return "", fmt.Errorf("fejkdata: %w", err) } - f.set = holdSet{} - sc := renderScope{set: &f.set} + var set holdSet + sc := renderScope{set: &set} f.root.children = f.categories n, err := descend(f.rand, &f.root, segments, sc) if err != nil { diff --git a/todo.md b/todo.md index f0027c2..c13eacd 100644 --- a/todo.md +++ b/todo.md @@ -23,9 +23,6 @@ Shape 5.8, Self-sufficiency 5.7), every seat capped by Locality, all nine naming This round, in order: -- Give `Fake` a local hold set like `FakeRecord`, `RecordTemplate.Fake` and - `FakeStruct`, or state at `Generator.set` why it alone needs one: four seats read the - field's heap claim as contradicted by the other three. - Spell every panic an earlier check makes unreachable with one greppable phrase: the 17 say "reached prep unvalidated", "should have been proved", "with no row pinned" and more, so a user's report greps to nothing.