Skip to content

A nested cell renders as Go's map[runs:3], which nothing downstream can read #751

Closed

Description

@David-Noble-at-work

A nested value in a table, csv, or value cell renders in Go's own notation.

health
------
map[runs:3]

Cause

csvCellValue (pkg/result/delimited.go:368) ends in fmt.Sprint(rv.Interface()). For a map or a struct
that yields Go's map[runs:3] or {3 []} -- a rendering that names the language rather than the data, and
that nothing downstream can read. Piping it back into jq is impossible.

It is the same failure PowerShell has with @{runs=3}, and for the same reason: presenting the language's
value instead of the normalized data.

Fix

A non-scalar cell renders as compact JSON -- {"runs":3}, ["a","b"] -- at any depth, never truncated.
Columns stay shallow, and the cell holds the native format, so it pipes back into jq. Flattening to
health.runs remains available through --jq, chosen explicitly.

Types that render themselves are excluded: an error, a fmt.Stringer, an encoding.TextMarshaler. A
time.Time is a struct, and JSON-encoding it would replace the form it defines for itself.

Documented in docs/architecture/10-command-line-interface.md §8.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions