var Analyzer = &analysis.Analyzer{ Name: "ctrlflow", Doc: "build a control-flow graph", URL: "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/ctrlflow", Run: run, ResultType: reflect.TypeOf(new(CFGs)), FactTypes: []analysis.Fact{new(noReturn)}, Requires: []*analysis.Analyzer{inspect.Analyzer}, }
A CFGs holds the control-flow graphs for all the functions of the current package.
type CFGs struct {
// contains filtered or unexported fields
}
func (c *CFGs) FuncDecl(decl *ast.FuncDecl) *cfg.CFG
FuncDecl returns the control-flow graph for a named function. It returns nil if decl.Body==nil.
func (c *CFGs) FuncLit(lit *ast.FuncLit) *cfg.CFG
FuncLit returns the control-flow graph for a literal function.