Skip to content

Commit 6f0afba

Browse files
zimegmwbrooks
andauthored
refactor: loop over a range of integers starting from zero in shorthand (#110)
Co-authored-by: Michael Brooks <[email protected]>
1 parent 662186b commit 6f0afba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/api/icon_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ func TestClient_IconSuccess(t *testing.T) {
7373
myimage := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{100, 100}})
7474

7575
// This loop just fills the image with random data
76-
for x := 0; x < 100; x++ {
77-
for y := 0; y < 100; y++ {
76+
for x := range 100 {
77+
for y := range 100 {
7878
c := color.RGBA{uint8(rand.Intn(255)), uint8(rand.Intn(255)), uint8(rand.Intn(255)), 255}
7979
myimage.Set(x, y, c)
8080
}

internal/hooks/hook_executor_v2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func generateMD5FromRandomString() string {
106106
const length = 10
107107

108108
randomBytes := make([]byte, 0)
109-
for i := 0; i < length; i++ {
109+
for range length {
110110
num, err := rand.Int(rand.Reader, big.NewInt(int64(len(alphanumericCharacters))))
111111
if err != nil {
112112
return "3561f3a3c5576e2ce0dc0d1e268bb9b2" // Return default value to continue execution

0 commit comments

Comments
 (0)