1
0
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:
Ivan Trubach
2022-06-18 19:47:53 +03:00
committed by GitHub
parent 76ef1d75d1
commit dc30eb1182
13 changed files with 153 additions and 40 deletions

View File

@@ -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,