-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to golangci-lint 1.61.0 (#592)
I accidentally upgraded my golangci-lint locally, so figured I may as well take it up a version in CI as well. The main new drama queen for this version is fatcontext [1]. It looks like it's a well-intentioned lint, which tries to avoid having callers set context in loops and inadvertently create a super deep context that causes performance issues: func notOk() { ctx := context.Background() for i := 0; i < 10; i++ { ctx = context.WithValue(ctx, "key", i) // "nested context in loop" _ = ctx } } Unfortunately, as with many well-intentioned golangci-lint additions, its heuristic is overly broad, and it produces a lot of false positives (in fact, 100% of lines it found were false positives). I've marked lines `nolint:fatcontext` for now, but this may be one that we disable if it gets too annoying because it's almost certainly more cost than benefit. The good news is that we get upgraded version of `gosec`, and some of the lines that were marked as `nolint` and which were false positives on unsafe integer conversion (they were always safe) can be removed. [1] https://github.com/Crocmagnon/fatcontext
- Loading branch information
Showing
8 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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