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

Warn on unused method receivers #118

Closed
chavacava opened this issue Apr 17, 2019 · 0 comments · Fixed by #119
Closed

Warn on unused method receivers #118

chavacava opened this issue Apr 17, 2019 · 0 comments · Fixed by #119
Assignees
Labels
rule proposal Issue proposing a new rule

Comments

@chavacava
Copy link
Collaborator

chavacava commented Apr 17, 2019

In GO it is possible to define a method that does not use its receiver:

func (ms *myStruct) Foo() { return }

The above method can be also written to explicitly state that the receiver is not used:

func (_ *myStruct) Foo() { return }

or

func (*myStruct) Foo() { return }

I propose to create a new rule (unused-receiver?) to cope with this pattern

@chavacava chavacava added the rule proposal Issue proposing a new rule label Apr 17, 2019
@chavacava chavacava assigned chavacava and unassigned chavacava Apr 17, 2019
@chavacava chavacava changed the title Extend unused-param to warn on unused method receivers Warn on unused method receivers Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule proposal Issue proposing a new rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant