Skip to content

Enabled modernize linter configuration.#3432

Open
atombrella wants to merge 2 commits into
istio:masterfrom
atombrella:feature/modernize_enable_clean
Open

Enabled modernize linter configuration.#3432
atombrella wants to merge 2 commits into
istio:masterfrom
atombrella:feature/modernize_enable_clean

Conversation

@atombrella

@atombrella atombrella commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Spawned from #3399 which is too messy to clean up because I made some mistakes with git.
@Stevenjin8 @fjglira Can you please add the ok-to-test label, so this one could land more quickly. Thank you!

Modernize is a golang tool that contains many built-in replacements to use newer golang semantics and standard library features. The PR enables the rules that have been dealt with in the istio repository.

The entire list for GoLang 1.26 is in the documentation.
https://golangci-lint.run/docs/linters/configuration/#modernize

  • forvar. I believe it's already covered by copyloopvar, so it's easier to just enable it here.
  • rangeint (currently on its way to being enforced in istio in a PR).
  • Some strings-rules
  • slicescontains and slicessort have only been dealt with in batches. These rules are also quite neat to simplify code. I fixed the few cases of slicescontains that modernize found. It also removed one internal function.

@atombrella
atombrella requested a review from a team as a code owner July 11, 2026 08:09
@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test labels Jul 11, 2026
@istio-testing

Copy link
Copy Markdown
Contributor

Hi @atombrella. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 11, 2026
@istio-policy-bot

Copy link
Copy Markdown

🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test?

Courtesy of your friendly test nag.

@fjglira

fjglira commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants