mirror of
https://github.com/mgechev/revive.git
synced 2025-11-27 22:18:41 +02:00
fix(receiver-naming): distinguish types with parameters (#692)
* fix(receiver-naming): distinguish types with parameters * chore: run tests using supported Go versions matrix
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"go/ast"
|
||||
|
||||
"github.com/mgechev/revive/internal/typeparams"
|
||||
"github.com/mgechev/revive/lint"
|
||||
)
|
||||
|
||||
@@ -65,7 +66,7 @@ func (w lintReceiverName) Visit(n ast.Node) ast.Visitor {
|
||||
})
|
||||
return w
|
||||
}
|
||||
recv := receiverType(fn)
|
||||
recv := typeparams.ReceiverType(fn)
|
||||
if prev, ok := w.typeReceiver[recv]; ok && prev != name {
|
||||
w.onFailure(lint.Failure{
|
||||
Node: n,
|
||||
|
||||
Reference in New Issue
Block a user