Skip to content

Enable the modernize analyzer and apply it - #2315

Merged
csatib02 merged 1 commit into
masterfrom
chore/modernize
Aug 11, 2026
Merged

Enable the modernize analyzer and apply it#2315
csatib02 merged 1 commit into
masterfrom
chore/modernize

Conversation

@csatib02

Copy link
Copy Markdown
Member

Summary

golangci-lint gains the modernize analyzer, and the tree is updated to satisfy it across all
three modules.

The changes are mechanical and behaviour-preserving: range over an integer in place of a
three-clause loop, slices and maps helpers in place of hand-written loops, the min and
max builtins, and new(x) in place of a local variable taken by address.

One helper went with them. persistentVolumeModePointer wrapped new(mode) for a single
caller, which the inline analyzer flags, so the call is inlined and the helper removed.

Test plan

  • make lint reports no issues on the root, SDK and e2e modules
  • make test passes
  • make check-diff exits 0, so no generated file drifts

golangci-lint gains the modernize analyzer, and the tree is updated to satisfy
it. The changes are mechanical: range-over-int loops, slices and maps helpers in
place of hand-written loops, min and max builtins, and new(x) in place of a
local variable taken by address.

persistentVolumeModePointer went with them. It wrapped new(mode) for a single
caller, which the inline analyzer flags.

Signed-off-by: Bence Csati <bence.csati@axoflow.com>
@csatib02 csatib02 self-assigned this Aug 11, 2026
@csatib02 csatib02 added the enhancement New feature or request label Aug 11, 2026
@csatib02
csatib02 merged commit 31ba188 into master Aug 11, 2026
33 checks passed
@csatib02
csatib02 deleted the chore/modernize branch August 11, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant