Enable the modernize analyzer and apply it - #2315
Merged
Merged
Conversation
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
force-pushed
the
chore/modernize
branch
from
August 11, 2026 10:42
eb04b7c to
2436d61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
golangci-lint gains the
modernizeanalyzer, and the tree is updated to satisfy it across allthree modules.
The changes are mechanical and behaviour-preserving:
rangeover an integer in place of athree-clause loop,
slicesandmapshelpers in place of hand-written loops, theminandmaxbuiltins, andnew(x)in place of a local variable taken by address.One helper went with them.
persistentVolumeModePointerwrappednew(mode)for a singlecaller, which the
inlineanalyzer flags, so the call is inlined and the helper removed.Test plan
make lintreports no issues on the root, SDK and e2e modulesmake testpassesmake check-diffexits 0, so no generated file drifts