Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused parameter from pick function #932

Merged
merged 1 commit into from
Nov 6, 2023
Merged

refactor: remove unused parameter from pick function #932

merged 1 commit into from
Nov 6, 2023

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Nov 4, 2023

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 chavacava merged commit ccae54e into mgechev:master Nov 6, 2023
12 checks passed
@chavacava
Copy link
Collaborator

Thank you @alexandear

@alexandear alexandear deleted the rule-refactor-pick-unparam branch November 6, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants