Documentation ¶
Index ¶
Constants ¶
View Source
const PreserveScope = "preserveScope"
Variables ¶
View Source
var DeviatingFuncs = map[Call]BranchKind{ {"os", "Exit"}: Exit, {"log", "Fatal"}: Exit, {"log", "Fatalf"}: Exit, {"log", "Fatalln"}: Exit, {"", "panic"}: Panic, {"log", "Panic"}: Panic, {"log", "Panicf"}: Panic, {"log", "Panicln"}: Panic, }
DeviatingFuncs lists known control flow deviating function calls.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch struct { Call BranchKind HasDecls bool }
Branch stores the branch's information within an if-else statement.
func BlockBranch ¶
func StmtBranch ¶
type BranchKind ¶
type BranchKind int
const ( Empty BranchKind = iota // Return branches return from the current function Return // Continue branches continue a surrounding `for` loop Continue // Break branches break out of a surrounding `for` loop Break // Goto branches jump to a label Goto // Panic panics the current program Panic // Exit exits the current program Exit // Regular branches not categorized as any of the above Regular )
func (BranchKind) Branch ¶
func (k BranchKind) Branch() Branch
func (BranchKind) Deviates ¶
func (k BranchKind) Deviates() bool
func (BranchKind) IsEmpty ¶
func (k BranchKind) IsEmpty() bool
func (BranchKind) Returns ¶
func (k BranchKind) Returns() bool
func (BranchKind) String ¶
func (k BranchKind) String() string
Click to show internal directories.
Click to hide internal directories.