-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chore] Add intrange linter #38009
base: main
Are you sure you want to change the base?
[chore] Add intrange linter #38009
Conversation
7eb69c1
to
9b6ccd3
Compare
9b6ccd3
to
cf91116
Compare
d8dbd0f
to
16f72c9
Compare
1b8107d
to
f6db2b5
Compare
f6db2b5
to
0d634b9
Compare
remarks / observationsThe
and
do different things; the range loop calls Even simpler, a range loop has different semantics if the ranged-over integer variable is changed inside the loop body. The
where Other issues that requires manual changes
ConclusionBlindly converting for loops into range loops with the |
The intrange linter checks that for loops use the Go 1.22+ range loop syntax if possible.