Skip to content

fix: prevent unnecessary copy in loop #769

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

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

avorima
Copy link
Contributor

@avorima avorima commented Apr 3, 2025

The for loop was changed in go 1.22 to no longer reuse loop variables. This means that it's now safe to take pointers of loop variables.

I scanned the repo for other occurrences, but could only find this one.

Copy link

netlify bot commented Apr 3, 2025

Deploy Preview for kamaji-documentation canceled.

Name Link
🔨 Latest commit a5d08c5
🔍 Latest deploy log https://app.netlify.com/sites/kamaji-documentation/deploys/67eec7fbd0d15c0008f03332

@prometherion
Copy link
Member

I was looking for a golangci-lint option but it seems we don't have it. LGTM!

@prometherion prometherion merged commit 94a64d1 into clastix:master Apr 7, 2025
11 checks passed
@avorima avorima deleted the adapt-loop-copy branch April 7, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants