MCPcopy Index your code
hub / github.com/docker/docker-agent / inspectConstructionBody

Function inspectConstructionBody

lint/constructor_purity.go:76–81  ·  view source on GitHub ↗

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))

Source from the content-addressed store, hash-verified

74// are immediately invoked (func() { ... })(), in which case their body runs
75// during construction and is inspected.
76func inspectConstructionBody(body *ast.BlockStmt, visit func(ast.Node)) {
77 if body == nil {
78 return
79 }
80 inspectConstructionNode(body, visit)
81}
82
83func inspectConstructionNode(root ast.Node, visit func(ast.Node)) {
84 ast.Inspect(root, func(n ast.Node) bool {

Callers 2

Calls 1

inspectConstructionNodeFunction · 0.85

Tested by

no test coverage detected