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:
parent
c38582b7e6
commit
45a7a9599c
1 changed files with 2 additions and 11 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue