Skip to content
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

refactor: remove unneeded in Go 1.22 loop var copy #4856

Merged
merged 1 commit into from
May 12, 2024

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented May 11, 2024

The PR cleans up unnecessary loop variable copying and enables the copyloopvar linter for detecting this redundant variable copying.

Additional notes

After the project upgraded to Go version 1.22 in #4779, copying variables inside a for loop became unnecessary. See this blog post for a detailed explanation.

The copyloopvar linter is only available from golangci-lint v1.57 onwards, so we also need to update this tool.

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 11, 2024
Copy link

codecov bot commented May 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.77%. Comparing base (c68d830) to head (8047f89).
Report is 256 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4856      +/-   ##
==========================================
- Coverage   83.77%   83.77%   -0.01%     
==========================================
  Files         135      139       +4     
  Lines       13029    11204    -1825     
==========================================
- Hits        10915     9386    -1529     
+ Misses       1677     1355     -322     
- Partials      437      463      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caarlos0 caarlos0 added the enhancement New feature or request label May 12, 2024
@caarlos0 caarlos0 merged commit 00a376c into goreleaser:main May 12, 2024
11 checks passed
@caarlos0
Copy link
Member

thank you!

@alexandear alexandear deleted the refactor/remove-loop-var-copy branch May 12, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants