Documentation ¶
Overview ¶
Package check processes an ast.Function and finds used but (possibly) not initialized, and initialized but (possibly) not used. "possibly" meaning not on all code paths. Does not check nested functions (they're already codegen and not Ast) they are checked as constructed bottom up.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct { // AllInit is the set of variables assigned to, including conditionally AllInit map[string]int // AllUsed is the set of variables read from, including conditionally AllUsed map[string]struct{} // contains filtered or unexported fields }
func (*Check) CheckFunc ¶
CheckFunc is the main entry point. It can be called more than once (for nested functions).
func (*Check) CheckFunc2 ¶
func (*Check) CheckGlobal ¶
CheckGlobal checks if a global name is defined. It is also called by compile constant to check class base.
func (*Check) CheckResult ¶
func (*Check) CheckResults ¶
CheckResults returns the results sorted by code position
Click to show internal directories.
Click to hide internal directories.