-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
Description
When applying the "extract method pattern" I quite often forget to actually
use extracted arguments and keep the hardcoded values in the the extracted function
which leads to errors.
I think that for not exported functions at least vet should complain about unused
function arguments. My personal opinion is that I would treat unused arguments of not
exported functions the same as unused variables (and cause a compiler error).
For exported functions things are a bit different because of API stability reasons. A
similar workaround to handling unused variables ("_ = unusedArgument" at the
beginning of the function) would be possible though and also enable documenting (via
comment) why a specific arguments is not used.