From f7d9e3fb715e54600183a8ed78712413baa366df Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 7 Oct 2026 01:08:51 +0200 Subject: [PATCH] Delete the doc lines the panel read as restating their code --- calc.go | 4 ++-- data.go | 4 ---- fejkdata.go | 1 - inline.go | 1 - pick.go | 1 - record.go | 4 +--- render.go | 2 -- resolve.go | 8 ++++---- table.go | 1 - 9 files changed, 7 insertions(+), 19 deletions(-) diff --git a/calc.go b/calc.go index 78b95e8..e61c9f7 100644 --- a/calc.go +++ b/calc.go @@ -11,8 +11,8 @@ import ( "github.com/larvit/fejkdata/internal/invariant" ) -// checkCalcFields runs checkOperands over the calc operands fields hold. An operand no field -// holds is left for a name, which checkCalcNames checks once names resolve. +// checkCalcFields leaves an operand no field holds for a name, which checkCalcNames checks once +// names resolve. func checkCalcFields(args []string, fields map[string]node) error { return checkOperands(args[0], builtinfunc.ParsedCalc(args[0]), func(name string) []node { if n, ok := fields[name]; ok { diff --git a/data.go b/data.go index 6d89042..1ab23db 100644 --- a/data.go +++ b/data.go @@ -25,7 +25,6 @@ func loadData(sources []datafiles.Source) (map[string]node, error) { return root, nil } -// compileInto compiles each category it is handed into the folder place returns for its Folders. func compileInto(place func(dir []string) *folder) func(datafiles.Category) error { return func(c datafiles.Category) error { n, err := compileCategory(c) @@ -51,9 +50,6 @@ func madeFolder(root *folder, dir []string) *folder { return g } -// mergeChildren overlays src onto dst. Two folders under the same key merge -// recursively (so locales/categories from several paths combine); every other -// key is replaced, making the last-loaded directory win on a conflict. func mergeChildren(dst, src map[string]node) { for k, v := range src { if dg, ok := dst[k].(*folder); ok { diff --git a/fejkdata.go b/fejkdata.go index 64ea95a..cd04201 100644 --- a/fejkdata.go +++ b/fejkdata.go @@ -220,7 +220,6 @@ func join(prefix, name string) string { return prefix + "." + name } -// randomBytes seeds an unseeded generator. var randomBytes = crand.Read // drawSeed is the seed WithSeed gave, or one read from the system's entropy. diff --git a/inline.go b/inline.go index 0d42957..b84e27f 100644 --- a/inline.go +++ b/inline.go @@ -18,7 +18,6 @@ type Template struct { n node } -// Fake renders the template once. func (t *Template) Fake() string { t.g.mu.Lock() defer t.g.mu.Unlock() diff --git a/pick.go b/pick.go index 46eab40..07c1a77 100644 --- a/pick.go +++ b/pick.go @@ -76,7 +76,6 @@ type frameStack struct { frames []*pickFrame } -// push opens f until pop closes it, returning the mark pop takes. func (st *frameStack) push(f *pickFrame) int { mark := len(st.frames) st.frames = append(st.frames, f) diff --git a/record.go b/record.go index 0768845..8979f8e 100644 --- a/record.go +++ b/record.go @@ -30,7 +30,6 @@ type Record struct { columns []Column } -// Columns returns the record's columns in name order. func (r *Record) Columns() []Column { return append([]Column(nil), r.columns...) } @@ -214,8 +213,7 @@ func (f *Generator) FakeRecordTemplate(input string) (*Record, error) { // the record to write instead. var ErrNoColumns = errors.New("has no fields, so no columns") -// recordOf is the record template n is, the fence FakeRecord, NewRecordTemplate and FakeStruct -// pass; settleRecords fixed its columns at load. +// recordOf is the record template n is; settleRecords fixed its columns at load. func recordOf(n node) (*template, error) { if tb, isTable := n.(*table); isTable { n = tb.formatTemplate diff --git a/render.go b/render.go index 4fdd141..c369b89 100644 --- a/render.go +++ b/render.go @@ -109,8 +109,6 @@ func renderRepeat(s *drawstate.State, t *template, env renderEnv) string { return b.String() } -// drawItem selects one item. Uniform choices are O(1); weighted choices are an -// O(log n) search over precomputed cumulative weights. func drawItem(s *drawstate.State, c *choice) node { if c.cum == nil { return c.items[s.IntN(len(c.items))] diff --git a/resolve.go b/resolve.go index 0d94386..0ec8927 100644 --- a/resolve.go +++ b/resolve.go @@ -61,10 +61,10 @@ type resolvedNames struct { uses map[*nameBinding][]nameUse } -// resolveTemplates resolves ts in steps, each over every template before the next starts. Each step -// returns what it builds. The references, the compiled format and the column read are kept on each -// template. The names' targets, keys and reads pass to later steps as arguments, and the bindings -// take their targets and keys only once every check has passed. +// resolveTemplates resolves ts in steps, each over every template before the next starts. The +// references, the compiled format and the column read are kept on each template. The names' +// targets, keys and reads pass to later steps as arguments, and the bindings take their targets +// and keys only once every check has passed. func resolveTemplates(ts []templateSite, root map[string]node) error { for _, s := range ts { refs, err := s.t.resolveRefs(s.folder, s.label, s.category, root) diff --git a/table.go b/table.go index 4eed165..deaef03 100644 --- a/table.go +++ b/table.go @@ -50,7 +50,6 @@ func (t *table) cellTemplate(row, col int) *template { func (t *table) cellIndex(row, col int) int { return row*len(t.rows.Header()) + col } -// tableOptions are the keys a table object takes; every other key is refused. var tableOptions = []string{"format", "key", "name", "parent", "rows", "weight"} func isTableOption(name string) bool {