Enabled modernize linter configuration.#3432
Conversation
|
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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
🤔 🐛 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. |
|
/ok-to-test |
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-testlabel, 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).slicescontainsandslicessorthave only been dealt with in batches. These rules are also quite neat to simplify code. I fixed the few cases ofslicescontainsthat modernize found. It also removed one internal function.