Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33
@@ -291,10 +291,12 @@ ok, err := fejkdata.IsTemplate(arg) // an inline template by its shape, el
|
||||
| `WithDataFS(fsys)` | layer an `fs.FS`, such as your own `embed.FS` |
|
||||
| `WithoutShippedData()` | load only what you give |
|
||||
|
||||
`New` refuses a mistake in the data and `NewTemplate` one in the template, so on a
|
||||
loaded generator `Fake` fails only for a path that names nothing or could name two
|
||||
things, `FakeStruct` only for a non-struct argument or a type its tags do not describe,
|
||||
with the same error every call, and `Template.Fake` cannot fail at all.
|
||||
`New` refuses a mistake in the data, and `NewTemplate` one in the template. On a loaded
|
||||
generator, each with the same error every call:
|
||||
|
||||
- `Fake` fails only for a path that names nothing or could name two things.
|
||||
- `FakeStruct` fails only for a non-struct argument or a type its tags do not describe.
|
||||
- `Template.Fake` cannot fail.
|
||||
|
||||
A `*Record` carries its columns via `Columns()` — each a `Column` of `Name`,
|
||||
`DataType`, rendered `Value` and `Null` — and serializes them with `JSON()`
|
||||
@@ -852,7 +854,7 @@ the Development section below, and who ships a register the five above then draw
|
||||
10. **Docs index the grammar** — every syntax feature is a heading; every example
|
||||
runs under test and shows its output; a rule is stated once.
|
||||
11. **Fast enough to be free** — a value renders in about a microsecond and `New`
|
||||
parses and validates the whole set once upfront, so generating fixtures stays
|
||||
parses and validates the whole set once up front, so generating fixtures stays
|
||||
noise against a test's own runtime.
|
||||
12. **Data is sourced, or on its way there** — a shipped fact, a name, place,
|
||||
code, id or classification, is read from a register or open dataset by a
|
||||
|
||||
@@ -210,7 +210,9 @@ by a `data-import/` script, as README goal 12 asks.
|
||||
|
||||
- Report every mistake a load finds in one error, as the decision "A load reports every
|
||||
mistake at once" states: `New` and `NewTemplate` stop at the first, so data holding
|
||||
two mistakes takes two runs to fix. Split it into sub-items before starting.
|
||||
two mistakes takes two runs to fix. Split it into sub-items before starting, one of
|
||||
them the shape a Go caller iterates and the CLI prints, and reword the README's
|
||||
"`New` refuses a mistake in the data" to every mistake.
|
||||
- Rename `newRand` to `newGeneratorState` and `Generator.rand` to `state`: both name
|
||||
half of a `generatorState`, hiding its `{seq()}` counters, and `New`'s local `rng`
|
||||
shadows the `rng` interface.
|
||||
|
||||
Reference in New Issue
Block a user