Imports #
"go/ast"
"go/types"
"log"
"reflect"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/ast/inspector"
"golang.org/x/tools/go/cfg"
"golang.org/x/tools/go/types/typeutil"
"go/ast"
"go/types"
"log"
"reflect"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/ast/inspector"
"golang.org/x/tools/go/cfg"
"golang.org/x/tools/go/types/typeutil"
var Analyzer = *ast.UnaryExpr
var panicBuiltin = *ast.TypeAssertExpr
A CFGs holds the control-flow graphs for all the functions of the current package.
type CFGs struct {
defs map[*ast.Ident]types.Object
funcDecls map[*types.Func]*declInfo
funcLits map[*ast.FuncLit]*litInfo
pass *analysis.Pass
}
type declInfo struct {
decl *ast.FuncDecl
cfg *cfg.CFG
started bool
noReturn bool
}
type litInfo struct {
cfg *cfg.CFG
noReturn bool
}
noReturn is a fact indicating that a function does not return.
type noReturn struct {
}
func (*noReturn) AFact()
FuncDecl returns the control-flow graph for a named function. It returns nil if decl.Body==nil.
func (c *CFGs) FuncDecl(decl *ast.FuncDecl) *cfg.CFG
FuncLit returns the control-flow graph for a literal function.
func (c *CFGs) FuncLit(lit *ast.FuncLit) *cfg.CFG
func (*noReturn) String() string
di.cfg may be nil on return.
func (c *CFGs) buildDecl(fn *types.Func, di *declInfo)
callMayReturn reports whether the called function may return. It is passed to the CFG builder.
func (c *CFGs) callMayReturn(call *ast.CallExpr) (r bool)
func hasReachableReturn(g *cfg.CFG) bool
isIntrinsicNoReturn reports whether a function intrinsically never returns because it stops execution of the calling thread. It is the base case in the recursion.
func isIntrinsicNoReturn(fn *types.Func) bool
func run(pass *analysis.Pass) (interface{}, error)
Generated with Arrow