fix(lint): replace reclaim_scope eq closure with slices.Equal (gosec G602) (#5010)

Main went red at c38582b7e: golangci-lint's gosec flags
internal/storage/conformance/reclaim_scope.go:61 with G602 because the
eq closure ranges over got while indexing want; the len-equality guard
on the preceding line makes it safe, but gosec cannot prove it.

slices.Equal is behaviorally identical and removes the indexing
entirely. Verified: build (CGO_ENABLED=0 -tags gms_pure_go), go vet,
gofmt, and golangci-lint over the package all clean.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie
This commit is contained in:
matt wilkie 2026-07-24 06:41:26 -07:00 • committed by GitHub
commit 45a7a9599c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
package conformance
import (
"slices"
"sort"
"testing"
"time"
@ -53,17 +54,7 @@ func testReclaimScoped(t *testing.T, f Factory) {
must(t, err)
return got.Status == types.StatusInProgress
}
eq := func(got, want []string) bool {
if len(got) != len(want) {
return false
}
for i := range got {
if got[i] != want[i] {
return false
}
}
return true
}
eq := slices.Equal[[]string]
// --label (AND-set): only lane-b's stale lease is reverted; the lane-a and
// unlabeled claims are untouched even though a global reaper would take them.