From 5420d33a4af771a53e80bd3f208662717fae9924 Mon Sep 17 00:00:00 2001 From: "@zimeg" Date: Thu, 29 May 2025 10:48:39 -0700 Subject: [PATCH] refactor: loop over a range of integers starting from zero in shorthand --- internal/api/icon_test.go | 4 ++-- internal/hooks/hook_executor_v2.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/icon_test.go b/internal/api/icon_test.go index b5833ba8..67117d93 100644 --- a/internal/api/icon_test.go +++ b/internal/api/icon_test.go @@ -73,8 +73,8 @@ func TestClient_IconSuccess(t *testing.T) { myimage := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{100, 100}}) // This loop just fills the image with random data - for x := 0; x < 100; x++ { - for y := 0; y < 100; y++ { + for x := range 100 { + for y := range 100 { c := color.RGBA{uint8(rand.Intn(255)), uint8(rand.Intn(255)), uint8(rand.Intn(255)), 255} myimage.Set(x, y, c) } diff --git a/internal/hooks/hook_executor_v2.go b/internal/hooks/hook_executor_v2.go index aca549d1..31e9aa0a 100644 --- a/internal/hooks/hook_executor_v2.go +++ b/internal/hooks/hook_executor_v2.go @@ -100,7 +100,7 @@ func generateMD5FromRandomString() string { const length = 10 randomBytes := make([]byte, 0) - for i := 0; i < length; i++ { + for range length { num, err := rand.Int(rand.Reader, big.NewInt(int64(len(alphanumericCharacters)))) if err != nil { return "3561f3a3c5576e2ce0dc0d1e268bb9b2" // Return default value to continue execution