Is your feature request related to a problem? Please describe.
The unused-parameter is phenomenally useful, however it doesn't seem to include anonymous functions. Had this linter included anonymous functions, we would have been able to catch a bug before it made its way into a recent release of ours.
Describe the solution you'd like
Anonymous functions should be tracked just like normal functions for unused variable usages.
In this example, a is unused. There could be a suggestion to use func(int) (or func(_ int) rather than func(a int).
Describe alternatives you've considered
Depending on how unused-parameter is implemented, it might make sense to have this be a separate rule entirely, like unused-receiver.
Additional context
Here is a bug fix that would have been prevented had this linter existed.
Is your feature request related to a problem? Please describe.
The
unused-parameter
is phenomenally useful, however it doesn't seem to include anonymous functions. Had this linter included anonymous functions, we would have been able to catch a bug before it made its way into a recent release of ours.Describe the solution you'd like
Anonymous functions should be tracked just like normal functions for unused variable usages.
In this example,
a
is unused. There could be a suggestion to usefunc(int)
(orfunc(_ int)
rather thanfunc(a int)
.Describe alternatives you've considered
Depending on how
unused-parameter
is implemented, it might make sense to have this be a separate rule entirely, likeunused-receiver
.Additional context
Here is a bug fix that would have been prevented had this linter existed.