ibc-go icon indicating copy to clipboard operation
ibc-go copied to clipboard

chore(all): remove copy of the 'for' variable

Open jjjike2021 opened this issue 8 months ago • 4 comments

Description

linter:

modules/core/genesis_test.go:284:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
                tc := tc
                ^
modules/core/genesis_test.go:421:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
                tc := tc
                ^
modules/core/genesis_test.go:449:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)

modules/core/04-channel/simulation/decoder_test.go:78:3: The copy of the 'for' variable "i" can be deleted (Go 1.22+) (copyloopvar)
                i, tt := i, tt

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.

  • [ ] Targeted PR against the correct branch (see CONTRIBUTING.md).
  • [ ] Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • [ ] Code follows the module structure standards and Go style guide.
  • [ ] Wrote unit and integration tests.
  • [ ] Updated relevant documentation (docs/).
  • [ ] Added relevant godoc comments.
  • [ ] Provide a conventional commit message to follow the repository standards.
  • [ ] Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • [ ] Re-reviewed Files changed in the GitHub PR explorer.
  • [ ] Review SonarCloud Report in the comment section below once CI passes.

jjjike2021 avatar Mar 18 '25 11:03 jjjike2021

thank you!

this helps me sleep better

faddat avatar Mar 23 '25 11:03 faddat

This is a good one, but I believe we have a lot of these around. Would you mind taking a closer look at the rest of the repo and fix this in a more cohesive way (so we stay consistent)

gjermundgaraba avatar Apr 01 '25 21:04 gjermundgaraba

I would be really happy too! I started to do this last night actually.

Just so you know, it will be necessary to upgrade go, because that will get us the latest set of linters. I will toss in a PR later today.

faddat avatar Apr 02 '25 02:04 faddat

This is a good one, but I believe we have a lot of these around. Would you mind taking a closer look at the rest of the repo and fix this in a more cohesive way (so we stay consistent)

@gjermundgaraba checked whole codespace

jjjike2021 avatar Apr 02 '25 03:04 jjjike2021