Describe the bugconfusing-naming check possibly misfires on different named methods of generic types.
To Reproduce
Steps to reproduce the behavior:
I updated revive go install github.com/mgechev/revive@latest
I run it with the following flags & configuration file:
command:
revive -config revive.toml test.go
config:
[rule.confusing-naming]
test.go:
package test
type a[T any] struct{}
func (x * a[T]) method() {
}
type b[T any] struct{}
func (x *b[T]) method() {
}
**Expected behavior**
Since methods are on different types, I expect check to pass
**Logs**
```shell
ā https://revive.run/r#confusing-naming Method 'method' differs only by capitalization to function 'method' in the same source file
test/test.go:11:16
ā 1 problem (1 error, 0 warnings)
Errors:
1 confusing-naming
Desktop (please complete the following information):
OS: [macOS]
Version of Go: 1.22
Additional context
The issue is previously mentioned in #864 but the error persists if the receiver of the method is of pointer type. Is this the expected behaviour?
I'm relatively new to go, sorry if this issue is due to my misunderstanding or lack of knowledge.
Hi @emredalkiran thanks for reporting the issue. I think the linter should be able to differentiate both methods and do not raise a warning in cases like yours.
Describe the bug
confusing-naming
check possibly misfires on different named methods of generic types.To Reproduce Steps to reproduce the behavior:
go install github.com/mgechev/revive@latest
config:
test.go:
type a[T any] struct{}
func (x * a[T]) method() { }
type b[T any] struct{}
func (x *b[T]) method() { }
Desktop (please complete the following information):
Additional context The issue is previously mentioned in #864 but the error persists if the receiver of the method is of pointer type. Is this the expected behaviour?
I'm relatively new to
go
, sorry if this issue is due to my misunderstanding or lack of knowledge.