miller/pkg/bifs
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
..
arithmetic.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
arithmetic_test.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
base.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
bits.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
bits_test.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
booleans.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
cmp.go Fix crash on array compare containing absent values (#2039) 2026-04-17 09:50:34 -04:00
collections.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
collections_test.go Add hasvalue builtin function (#2026) 2026-04-08 08:33:12 -04:00
datetime.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
hashing.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
hashing_test.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
mathlib.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
percentiles.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
random.go Next batch of lint fixes (#2108) 2026-06-28 17:36:36 -04:00
regex.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
relative_time.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
stats.go Convert if/else-if chains to typed switch statements (staticcheck QF1003) (#2112) 2026-06-28 18:27:42 -04:00
stats_test.go Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
strings.go Fix mlr -s shebang doc and reject arrays/maps in contains/index (#1658) (#2058) 2026-05-17 11:40:39 -04:00
system.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
types.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00