-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
linter: ideaidea of a linteridea of a linter
Description
Your feature request related to a problem? Please describe.
The following code sample highlights an issue where a map reference was unchecked (did not check ok == true) resulting in a nil pointer panic.
https://go.dev/play/p/XwjkvaEshlu
Describe the solution you'd like.
A linter to catch map references which only return 1 result, instead of both the value and the check.
Describe alternatives you've considered.
None
Additional context.
I looked at golangci-lint's linters but couldn't tell if this is already solved by existing linters.
I tested with golangci-lint 1.50.0 with flags --max-issues-per-linter 0 --enable-all --verbose but did not see any lint results related to the unsafe map usage.
PascalBourdier, mirakladp, Erouan50, magat, julien-michaud and 4 more
Metadata
Metadata
Assignees
Labels
linter: ideaidea of a linteridea of a linter