Skip to content

refactor: remove redundant variable declarations in for loops#4741

Merged
milosgajdos merged 1 commit intodistribution:mainfrom
efcking:main
Nov 19, 2025
Merged

refactor: remove redundant variable declarations in for loops#4741
milosgajdos merged 1 commit intodistribution:mainfrom
efcking:main

Conversation

@efcking
Copy link
Copy Markdown
Contributor

@efcking efcking commented Nov 19, 2025

The new version of Go has been optimized, and variables do not need to be reassigned.

For more info: https://tip.golang.org/wiki/LoopvarExperiment#does-this-mean-i-dont-have-to-write-x--x-in-my-loops-anymore

Signed-off-by: efcking <efcking@outlook.com>
Copy link
Copy Markdown
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I think there's a linter for this as well that we could enable

@milosgajdos milosgajdos merged commit d1218ce into distribution:main Nov 19, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants