1
0
mirror of https://github.com/mgechev/revive.git synced 2024-12-04 10:24:49 +02:00

deep-exit: fix mixed receiver type (lintDeepExit) (#1150)

This commit is contained in:
Denis Voytyuk 2024-11-30 10:06:59 +01:00 committed by GitHub
parent 7e1d35d8d2
commit 3bc240434f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ func (*DeepExitRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
failures = append(failures, failure)
}
w := lintDeepExit{onFailure: onFailure, isTestFile: file.IsTest()}
w := &lintDeepExit{onFailure: onFailure, isTestFile: file.IsTest()}
ast.Walk(w, file.AST)
return failures
}
@ -32,7 +32,7 @@ type lintDeepExit struct {
isTestFile bool
}
func (w lintDeepExit) Visit(node ast.Node) ast.Visitor {
func (w *lintDeepExit) Visit(node ast.Node) ast.Visitor {
if fd, ok := node.(*ast.FuncDecl); ok {
if w.mustIgnore(fd) {
return nil // skip analysis of this function