(n ast.Node)
| 705 | } |
| 706 | |
| 707 | func (t *walker) Visit(n ast.Node) ast.Visitor { |
| 708 | switch n := n.(type) { |
| 709 | case *ast.FuncDecl: |
| 710 | return t.funcType(n, n.Type) |
| 711 | |
| 712 | case *ast.BlockStmt: |
| 713 | newT := *t |
| 714 | newT.alreadyWrapped = make(map[*ast.Object]struct{}) |
| 715 | return &newT |
| 716 | |
| 717 | case *ast.AssignStmt: |
| 718 | t.assignStmt(n) |
| 719 | |
| 720 | case *ast.DeferStmt: |
| 721 | // This is a bit inefficient; |
| 722 | // we'll recurse into the DeferStmt's function literal (if any) twice. |
| 723 | t.deferStmt(n) |
| 724 | |
| 725 | case *ast.FuncLit: |
| 726 | return t.funcType(n, n.Type) |
| 727 | |
| 728 | case *ast.ReturnStmt: |
| 729 | return t.returnStmt(n) |
| 730 | } |
| 731 | |
| 732 | return t |
| 733 | } |
| 734 | |
| 735 | func (t *walker) funcType(parent ast.Node, ft *ast.FuncType) ast.Visitor { |
| 736 | // Clear state in case we're recursing into a function literal |
nothing calls this directly
no test coverage detected