Skip to content

Fix the linter#929

Merged
christopher-henderson merged 2 commits intomasterfrom
fixlint
Mar 16, 2025
Merged

Fix the linter#929
christopher-henderson merged 2 commits intomasterfrom
fixlint

Conversation

@christopher-henderson
Copy link
Copy Markdown
Member

@christopher-henderson christopher-henderson commented Mar 16, 2025

A handful were deprecated and no longer active.

level=warning msg="[lintersdb] The linter \"interfacer\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"nosnakecase\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"maligned\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"scopelint\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"gomnd\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"golint\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"ifshort\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The linter \"exhaustivestruct\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle"
level=warning msg="[lintersdb] The name \"goerr113\" is deprecated. The linter has been renamed to: err113."
level=warning msg="The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar."

copyloopvar points out that you no longer have to alias a loop variable before capturing it in a closure. But it's not wrong to still do so and there are too many of them in this code base.

intrange points out that these days you can do for i := range 10. There are too many c-style loops to care to go through all of them. Besides, I don't quite like how it implicitly starts at 0. I would have preferred something like the Rust syntax for i in 0..10.

err113 has an opinion on how to construct errors. Far too many of them to conform.

Not that anyone is listening, or that this is particularly actionable, but I have not been impressed Go's linters. Perhaps I am simply spoiled by Rust's clippy. One of the best features is that can automatically apply the lint's suggestion (correctly! I have never seen in generate bunk code).

@christopher-henderson christopher-henderson merged commit 900a4d0 into master Mar 16, 2025
9 checks passed
@christopher-henderson christopher-henderson deleted the fixlint branch March 16, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant