You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A single-object result has no correct rendering: table errors, csv makes one cell #752
Feature:#833 — Renderings: the pipeline from result value to stdout
A result that is a single object -- one layer, one package, one run -- has no correct rendering.
$ writ ... -o table
Error: result.TableFormatter: expected slice or array, got map[string]interface {}
$ writ ... -o csv
"map[name:x state:active]" <- the whole record in one cell
Two different wrong answers to the shape a command produces whenever it reports on one thing.
Cause
TableFormatter.Format (pkg/result/table.go:66) rejects anything that is not a slice or array. DelimitedFormatter.Format (pkg/result/delimited.go:110) treats any non-sequence as a single cell -- a
carve-out that is right for a scalar, since --jq '.count' depends on it, but wrong for an object.
Fix
A lone record is a sequence of one: headers from its keys, one row of values. A scalar stays one cell.
NAME STATE
x active
This is shape S3 in docs/architecture/10-command-line-interface.md §8.
Activity