miller/pkg/mlrval
John Kerl 2bec10fc54
Fix govet lint findings; fix masked unset-on-array error path (#2129)
* plans/lintfixes.md

* plans/lintfixes.md

* Fix remaining govet lint findings

- Rename MarshalJSON -> FormatAsJSON on Mlrval and Mlrmap (govet
  stdmethods): the methods shadowed json.Marshaler with an
  incompatible signature.
- Remove unreachable return after exhaustive if-else in
  pkg/mlrval/mlrval_collections.go (govet unreachable).
- Update plans/lintfixes.md with current status: 84 findings remain
  (50 errcheck, 34 staticcheck).

Part of #2109.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Return nil on successful single-index array unset

removeIndexedOnArray removed the element on the in-bounds path but
then fell through to return an "array index out of bounds for unset"
error, so the success path never returned nil. Callers currently
ignore the error, which masked this; return nil on success so that
upcoming errcheck fixes can propagate the error meaningfully. This
matches removeIndexedOnMap, which returns nil on success.

Add unit tests for RemoveIndexed on arrays.

Part of #2109.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:31:08 -04:00
..
mlrmap.go Lazy per-record hashing: ~15-30% faster on common workloads (#2081) 2026-06-19 16:37:42 -04:00
mlrmap_accessors.go Batch-arena field allocation for line-based readers (#2082) 2026-06-19 16:40:05 -04:00
mlrmap_accessors_test.go Implement mlr uniq -x (#1457) 2023-12-23 16:20:11 -05:00
mlrmap_flatten_unflatten.go Fix issue #1983 (#2040) 2026-04-19 10:44:53 -04:00
mlrmap_json.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrmap_new_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrmap_print.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_accessors.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_benchmark_test.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
mlrval_cmp.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
mlrval_cmp_test.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
mlrval_collections.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_collections_test.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_constants.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_copy.go Convert if/else-if chains to typed switch statements (staticcheck QF1003) (#2112) 2026-06-28 18:27:42 -04:00
mlrval_format.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_format_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrval_get.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_get_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_infer.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
mlrval_infer_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_is.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_is_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_json.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_new.go Convert if/else-if chains to typed switch statements (staticcheck QF1003) (#2112) 2026-06-28 18:27:42 -04:00
mlrval_new_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_output.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_output_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrval_sort.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_sort_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_type.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_type_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrval_yaml.go Allow empty-string keys in JSON and YAML input (#2068) 2026-05-27 20:19:03 -04:00
mlrval_yaml_test.go fix: preserve key order in YAML output (#2034) 2026-04-12 09:43:09 -04:00
record_arena.go Batch-allocate per-record objects; reuse CSV writer field buffer (#2083) 2026-06-19 17:03:04 -04:00