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

core: Fix golang linter issues with variables in loops and update linter version #13324

Merged
merged 1 commit into from Dec 5, 2023

Conversation

travisn
Copy link
Member

@travisn travisn commented Dec 5, 2023

Loop variables cannot be reliably uses since they will change with each iteration. Update these loop variable uses to be safe by indexing the slice rather than using the loop variable directly.

Also suppress the linter issues for passwords used in tests.

Updates the golangci-linter version to v1.55

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Copy link
Contributor

@subhamkrai subhamkrai left a comment

Choose a reason for hiding this comment

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

GolangCI is still failing

@travisn travisn added the skip-ci label Dec 5, 2023
@travisn travisn force-pushed the golangci-lint-update branch 2 times, most recently from b1982d6 to eb28d6c Compare December 5, 2023 21:01
Loop variables cannot be reliably uses since they will
change with each iteration. Update these loop variable
uses to be safe by indexing the slice rather than
using the loop variable directly.

Also suppress the linter issues for passwords used
in tests.

Signed-off-by: travisn <tnielsen@redhat.com>
@travisn travisn removed the skip-ci label Dec 5, 2023
@travisn travisn dismissed subhamkrai’s stale review December 5, 2023 21:20

The linter is passing now

@travisn travisn merged commit 8a7a6bb into rook:master Dec 5, 2023
52 checks passed
@travisn travisn deleted the golangci-lint-update branch December 5, 2023 21:46
travisn added a commit that referenced this pull request Dec 5, 2023
core: Fix golang linter issues with variables in loops and update linter version (backport #13324)
mergify bot added a commit that referenced this pull request Jan 5, 2024
core: Fix golang linter issues with variables in loops and update linter version (backport #13324)
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.

None yet

3 participants