Help us shape the future of Go! Take the 2026 Go Developer Survey

analysis

package
v1.17.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolValue

func BoolValue(expr ast.Expr, info *types.Info) (bool, bool)

func EscapingObjects

func EscapingObjects(n ast.Node, info *types.Info) []*types.Var

func HasBreak

func HasBreak(n ast.Node) bool

func HasSideEffect

func HasSideEffect(n ast.Node, info *types.Info) bool

Types

type FuncInfo

type FuncInfo struct {
	HasDefer bool
	// Nodes are "flattened" into a switch-case statement when we need to be able
	// to jump into an arbitrary position in the code with a GOTO statement, or
	// resume a goroutine after a blocking call unblocks.
	Flattened map[ast.Node]bool
	// Blocking indicates that either the AST node itself or its descendant may
	// block goroutine execution (for example, a channel operation).
	Blocking map[ast.Node]bool
	// GotoLavel indicates a label referenced by a goto statement, rather than a
	// named loop.
	GotoLabel map[*types.Label]bool
	// contains filtered or unexported fields
}

func (*FuncInfo) Visit

func (fi *FuncInfo) Visit(node ast.Node) ast.Visitor

type Info

type Info struct {
	*types.Info
	Pkg           *types.Package
	HasPointer    map[*types.Var]bool
	FuncDeclInfos map[*types.Func]*FuncInfo
	FuncLitInfos  map[*ast.FuncLit]*FuncInfo
	InitFuncInfo  *FuncInfo // Context for package variable initialization.
	// contains filtered or unexported fields
}

func AnalyzePkg

func AnalyzePkg(files []*ast.File, fileSet *token.FileSet, typesInfo *types.Info, typesPkg *types.Package, isBlocking func(*types.Func) bool) *Info

func (*Info) IsBlocking

func (info *Info) IsBlocking(fun *types.Func) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL