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

Fix false positive confusing-naming error on generics with pointer type receiver #985

Merged
merged 1 commit into from
May 11, 2024

Conversation

Entuazism
Copy link
Contributor

Fix logic to handle expressions that include pointers to generic types.
Add test data

Closes #982

Comment on lines 139 to 144
if p, _ := t.(*ast.StarExpr); p != nil {
t = p.X
}

if p, _ := t.(*ast.IndexExpr); p != nil {
t = p.X
Copy link
Collaborator

Choose a reason for hiding this comment

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

Preserving the original switch would be more idiomatic and let us avoiding type assertions multiple times.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to avoid a lot of code nesting. Returned the switch

@chavacava chavacava merged commit 993c9f6 into mgechev:master May 11, 2024
4 checks passed
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.

Possible false positive confusing-naming error on generics with pointer type receiver
3 participants