You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's completely legitimate to define methods by the same name on different types.
The false positive only happens when both x and y are generic. Defining one or both as a concrete type (such as type x struct{}) makes the issue disappear.
Expected behavior
No confusing-naming issue is reported.
Logs
test.go:10:13: Method 'method' differs only by capitalization to function 'method' in the same source file
Desktop (please complete the following information):
OS: Ubuntu 23.04
go version go1.20.6 linux/amd64
The text was updated successfully, but these errors were encountered:
Describe the bug
The
confusing-naming
check misfires on similarly named methods of distinct generic types.To Reproduce
Steps to reproduce the behavior:
go install github.com/mgechev/revive@latest
revive.toml:
test.go:
It's completely legitimate to define methods by the same name on different types.
The false positive only happens when both
x
andy
are generic. Defining one or both as a concrete type (such astype x struct{}
) makes the issue disappear.Expected behavior
No
confusing-naming
issue is reported.Logs
Desktop (please complete the following information):
go version go1.20.6 linux/amd64
The text was updated successfully, but these errors were encountered: