mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-18 00:45:47 +00:00
* fix: preserve key order in YAML output
MlrmapToYAMLNative converted the ordered Mlrmap to map[string]interface{},
which loses insertion order. yaml.v3.Marshal then sorts Go map keys
alphabetically, so YAML output always had sorted keys despite other formats
(JSON, pretty-print) correctly preserving order.
Switch to building yaml.Node trees that preserve the Mlrmap's linked-list
iteration order. Use yaml.Node.Encode for scalar values to correctly handle
edge cases (NaN/Inf, non-UTF-8 strings).
Fixes #2028.
* Update pkg/mlrval/mlrval_yaml_test.go with copilot code-review feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: lawrence3699 <lawrence3699@users.noreply.github.com>
Co-authored-by: John Kerl <kerl.john.r@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| channel_writer.go | ||
| doc.go | ||
| file_output_handlers.go | ||
| README.md | ||
| record_writer.go | ||
| record_writer_csv.go | ||
| record_writer_csv_colorizer.go | ||
| record_writer_csvlite.go | ||
| record_writer_dcf.go | ||
| record_writer_dkvp.go | ||
| record_writer_dkvpx.go | ||
| record_writer_factory.go | ||
| record_writer_json_jsonl.go | ||
| record_writer_markdown.go | ||
| record_writer_nidx.go | ||
| record_writer_pprint.go | ||
| record_writer_tsv.go | ||
| record_writer_xtab.go | ||
| record_writer_yaml.go | ||
Logic for formatting output records as strings to standard output.
There is one record-writer type per supported output file format, and a factory method.