mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.69k stars 273 forks source link

refactor: remove unused parameter from pick function #932

Closed alexandear closed 8 months ago

alexandear commented 8 months ago

This PR refactors internal function: remove the parameter f func(n ast.Node) []ast.Node from pick because it is always nil.

This refactoring was found by the unparam linter:

❯ go run mvdan.cc/unparam@latest ./...
lint/file.go:191:22: (*File).disabledIntervals$3 - filename is unused
lint/file.go:191:95: (*File).disabledIntervals$3 - result 0 ([]github.com/mgechev/revive/lint.DisabledInterval) is always nil
rule/utils.go:98:54: pick - f always receives nil
exit status 1
chavacava commented 8 months ago

Thank you @alexandear