Skip to content

Commit

Permalink
ruleguard: assign the current func decl (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte committed Dec 28, 2021
1 parent fd27736 commit 9ecd049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ruleguard/ast_walker.go
Expand Up @@ -303,10 +303,11 @@ func (w *astWalker) walk(n ast.Node) {
}

case *ast.FuncDecl:
prevFunc := w.filterParams.currentFunc
w.filterParams.currentFunc = n
if n.Doc != nil {
w.walk(n.Doc)
}
prevFunc := w.filterParams.currentFunc
if n.Recv != nil {
w.walk(n.Recv)
}
Expand Down

0 comments on commit 9ecd049

Please sign in to comment.