From b35d9ea9298ae6dfa2b2f576a3ebd967764fce5c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 15 Mar 2026 14:56:20 +0100 Subject: [PATCH] plugins: modernize: rangeint go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest modernize -rangeint -fix ./... Signed-off-by: Sebastiaan van Stijn --- plugins/content/local/store_test.go | 2 +- plugins/gc/scheduler_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/content/local/store_test.go b/plugins/content/local/store_test.go index 0ce3a9c9c9..0766134672 100644 --- a/plugins/content/local/store_test.go +++ b/plugins/content/local/store_test.go @@ -317,7 +317,7 @@ type checker interface { func generateBlobs(t checker, nblobs, maxsize int64) map[digest.Digest][]byte { blobs := map[digest.Digest][]byte{} - for i := int64(0); i < nblobs; i++ { + for range nblobs { p := make([]byte, randutil.Int63n(maxsize)) if _, err := rand.Read(p); err != nil { diff --git a/plugins/gc/scheduler_test.go b/plugins/gc/scheduler_test.go index 0c606043e7..d58c6839bb 100644 --- a/plugins/gc/scheduler_test.go +++ b/plugins/gc/scheduler_test.go @@ -85,7 +85,7 @@ func TestDeletionThreshold(t *testing.T) { // Increment deletion count 5, checking GC hasn't run in // between each call - for i := 0; i < 5; i++ { + for range 5 { time.Sleep(time.Millisecond) if c := tc.runCount(); c != 0 { t.Fatalf("GC ran unexpectedly")