Rename the folder node type from group to folder, freeing group for the draw option

This commit is contained in:
2026-09-15 23:25:39 +02:00
parent 246f99a319
commit 5ed45cc55c
7 changed files with 34 additions and 34 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ type rng interface {
func (f *Generator) Fake(path string) (string, error) {
f.mu.Lock()
defer f.mu.Unlock()
n, err := descend(f.rand, &group{children: f.categories}, strings.Split(path, "."))
n, err := descend(f.rand, &folder{children: f.categories}, strings.Split(path, "."))
if err != nil {
return "", fmt.Errorf("fejkdata: %s: %w", path, err)
}
if _, ok := n.(*group); ok {
if _, ok := n.(*folder); ok {
return "", fmt.Errorf("fejkdata: %s names a folder, not a value", path)
}
return renderOnce(f.rand, n), nil