Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteImport ¶
DeleteImport deletes the import with the given path (ignoring the name) from the file f, if present. If there are duplicate import declarations, all matching ones are deleted. modified from https://github.com/golang/tools/blob/master/go/ast/astutil/imports.go#L210
Types ¶
type ErrorHandler ¶
type ErrorHandler func(pos loader.Positioner, msg string)
type JumpTable ¶
type JumpTable map[*ast.BranchStmt]ast.Stmt
JumpTable when branch is token.GOTO then stmt is *ast.LabeledStmt when branch is labeld token.CONTINUE then stmt is *ast.ForStmt, *ast.RangeStmt when branch is labeld token.BREAK then stmt is *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt, *ast.ForStmt, *ast.RangeStmt
type TerminationChecker ¶
type TerminationChecker struct {
// contains filtered or unexported fields
}
func NewTerminationChecker ¶
func NewTerminationChecker(panicCallSites map[*ast.CallExpr]bool) *TerminationChecker
func (*TerminationChecker) IsTerminating ¶
func (t *TerminationChecker) IsTerminating(s ast.Stmt, label string) bool
IsTerminating reports if s is a terminating statement. If s is labeled, label is the label name; otherwise s is "".