Documentation ¶
Overview ¶
Package errcheck is the library used to implement the errcheck command-line tool.
Note: The API of this package has not been finalized and may change at any point.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoGoFiles is returned when CheckPackage is run on a package with no Go source files ErrNoGoFiles = errors.New("package contains no go source files") )
Functions ¶
func CheckPackages ¶
func CheckPackages(pkgPaths []string, ignore map[string]*regexp.Regexp, blank bool, types bool) error
CheckPackages checks packages for errors. ignore is a map of package names to regular expressions. Identifiers from a package are checked against its regular expressions and if any of the expressions match the call is not checked. If blank is true then assignments to the blank identifier are also considered to be ignored errors. If types is true then ignored type assertion results are also checked
Types ¶
type UncheckedErrors ¶
type UncheckedErrors struct { // Errors is a list of all the unchecked errors in the package. // Printing an error reports its position within the file and the contents of the line. Errors []error }
UncheckedErrors is returned from the CheckPackage function if the package contains any unchecked errors.
func (UncheckedErrors) Error ¶
func (e UncheckedErrors) Error() string
func (UncheckedErrors) Len ¶
func (e UncheckedErrors) Len() int
Len is the number of elements in the collection.
func (UncheckedErrors) Swap ¶
func (e UncheckedErrors) Swap(i, j int)
Swap swaps the elements with indexes i and j.