style: enable modernize analyzer#5231
Conversation
Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
|
@chuanshanjida CI does not pass here. |
Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
Modified. |
Hi @chuanshanjida. It appears that CI still does not pass. You can use |
I’ve already made the changes and tested locally. The reason the lint failed is that for a few third-party projects under the I’ve already run it now (but I’m thinking about whether we should exclude the graft directory from modernize, since these are third-party projects—should we modify their code?). |
You have good intuitions! There's a lot of geth code inside of graft that should not be linted, and in fact we have a specific linter and separate .golangci.yml for those projects. So yeah, we should not be applying the modernize linter to the graft subdirectory. If you want to be more specific we should not be applying it to upstream files, as listed in the text document. There is some code in graft/ that is our own. Does this make sense? |
Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
I think it’s like that~ I’ve already updated my .golangci.yml to exclude the graft directory. Also, do I need to squash several commits into one? |
The PR will be auto-squashed when merged so no. Regarding the CI, it still does not pass CI, so I don't believe you've configured it correctly. |
Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
Thanks for the guidance! Here's what I did: The I ran Also fixed a test regression in |
|
This is getting a lot closer! Can you resolve the conflict? |
Finally fetched successfully—haha😄. The conflicts are resolved. Please approve the CI again. @JonathanOppenheimer |
Still not passing :(. Let me know if you're having any trouble. |
Haha. We’re only one step away from success. This is a very easy error to fix. Error: evm/utils/bounded_workers.go:34:34: unnecessary leading newline (whitespace)
b.outstandingWorkers.Go(func() {
^
1 issues:
* whitespace: 1
FAIL: 'golangci_lint' failed at Wed Apr 15 09:02:44 UTC 2026
task: Failed to run task "lint-all-ci": exit status 255
Error: Process completed with exit code 201.Please approve the CI run again. I think there’s a good chance it will pass. @JonathanOppenheimer |
Can you include the PR description how you generated this PR? How much was automatically generated by the --fix lint flag? What did you have to change manually? |





Why this should be merged
Enables the modernize linter in .golangci.yml to enforce idiomatic modern. Go patterns, such as using built-in min/max, the slices/maps packages, and. other improvements introduced in recent Go versions.
How this works
How this was tested
Need to be documented in RELEASES.md?