vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.63k stars 2.1k forks source link

Chore: use new range for loops #15193

Open ajm188 opened 9 months ago

ajm188 commented 9 months ago

Feature Description

Go 1.22 introduced the ability to range over integers in a more concise manner, e.g.

for i := 0; i < n; i++

becomes

for i := range n

Use Case(s)

Modernize the codebase

Zen-cronic commented 2 months ago

hey, i was looking into this and found that as of the merged PR #16371, there're 815 occurrences across 350 files in this repo.

Script: rg -n --pcre2 'for i :=(?!.*range)'. Explained here.

So I believe this is gonna be a pretty tedious task, and that it should be shared among more than 1 contributors!