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

chore: Do not use methods on pointer and value receivers #3321

Merged
merged 1 commit into from
Jan 21, 2023
Merged

chore: Do not use methods on pointer and value receivers #3321

merged 1 commit into from
Jan 21, 2023

Conversation

alexandear
Copy link
Member

@alexandear alexandear commented Oct 24, 2022

Some types have methods on both value and pointer receivers. Such usage is not recommended by the Go Documentation:

The method is said to be bound to its receiver base type and the method name is visible only within [selectors](https://go.dev/ref/spec#Selectors) for type T or *T

This PR fixes that.

@ldez ldez added the topic: cleanup Related to code, process, or doc cleanup label Oct 24, 2022
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez enabled auto-merge (squash) January 21, 2023 13:09
@ldez ldez merged commit d193989 into golangci:master Jan 21, 2023
SeigeC pushed a commit to SeigeC/golangci-lint that referenced this pull request Apr 4, 2023
@ldez ldez added this to the v1.51 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cleanup Related to code, process, or doc cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants