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>
|
||
|---|---|---|
| .. | ||
| mlrmap.go | ||
| mlrmap_accessors.go | ||
| mlrmap_accessors_test.go | ||
| mlrmap_flatten_unflatten.go | ||
| mlrmap_json.go | ||
| mlrmap_new_test.go | ||
| mlrmap_print.go | ||
| mlrval_accessors.go | ||
| mlrval_benchmark_test.go | ||
| mlrval_cmp.go | ||
| mlrval_cmp_test.go | ||
| mlrval_collections.go | ||
| mlrval_constants.go | ||
| mlrval_copy.go | ||
| mlrval_format.go | ||
| mlrval_format_test.go | ||
| mlrval_get.go | ||
| mlrval_get_test.go | ||
| mlrval_infer.go | ||
| mlrval_infer_test.go | ||
| mlrval_is.go | ||
| mlrval_is_test.go | ||
| mlrval_json.go | ||
| mlrval_new.go | ||
| mlrval_new_test.go | ||
| mlrval_output.go | ||
| mlrval_output_test.go | ||
| mlrval_sort.go | ||
| mlrval_sort_test.go | ||
| mlrval_type.go | ||
| mlrval_type_test.go | ||
| mlrval_yaml.go | ||
| mlrval_yaml_test.go | ||