inspectConstructionBody walks body and visits nodes that run as part of executing the constructor. Nested function literals are skipped unless they are immediately invoked (func() { ... })(), in which case their body runs during construction and is inspected.
(body *ast.BlockStmt, visit func(ast.Node))
| 74 | // are immediately invoked (func() { ... })(), in which case their body runs |
| 75 | // during construction and is inspected. |
| 76 | func inspectConstructionBody(body *ast.BlockStmt, visit func(ast.Node)) { |
| 77 | if body == nil { |
| 78 | return |
| 79 | } |
| 80 | inspectConstructionNode(body, visit) |
| 81 | } |
| 82 | |
| 83 | func inspectConstructionNode(root ast.Node, visit func(ast.Node)) { |
| 84 | ast.Inspect(root, func(n ast.Node) bool { |
no test coverage detected