Require every choice variant to carry a path, and list only what Fake accepts
This commit is contained in:
@@ -141,7 +141,8 @@ av == bv // true
|
||||
```
|
||||
|
||||
`f.List()` returns the sorted paths the loaded data offers — the categories, their
|
||||
dotted fields and folder segments (what the CLI's `-list` prints).
|
||||
dotted fields and folder segments (what the CLI's `-list` prints). It is exactly the
|
||||
set `Fake` accepts.
|
||||
|
||||
A `*Fakes` is **not** safe for concurrent use — create one per goroutine.
|
||||
|
||||
@@ -362,7 +363,10 @@ no tokens at all, use a bare string node (`"100 Main St"`), emitted verbatim.
|
||||
|
||||
This yields e.g. `Anna Eriksson`, `Erik Berg`, or rarely `dr Astrid von Flemming`.
|
||||
Any field is reachable by dotted path — `Fake("person.last")` renders just a
|
||||
surname; choices along the path are resolved at random.
|
||||
surname; choices along the path are resolved at random. A path may continue
|
||||
*through* a choice only where every variant carries the rest of it (so
|
||||
`currency.symbol` works across all 16 currency variants), which keeps a path from
|
||||
rendering on one call and failing on the next.
|
||||
|
||||
### Performance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user