Documentation ¶
Overview ¶
Package gettercheck is the library used to implement the gettercheck command-line tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "gettercheck", Doc: "check for unused getters", Run: runAnalyzer, ResultType: reflect.TypeOf(Result{}), }
View Source
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 ¶
Types ¶
type Checker ¶
type Checker struct { // Exclusions defines code packages, symbols, and other elements that will not be checked. Exclusions Exclusions WriteGetters bool // The mod flag for go build. Mod string }
Checker checks that you checked errors.
func (*Checker) CheckPackage ¶
CheckPackage checks packages for errors that have not been checked.
It will exclude specific errors from analysis if the user has configured exclusions.
type Exclusions ¶
type Exclusions struct { // TestFiles excludes _test.go files. TestFiles bool // GeneratedFiles excludes generated source files. // // Source file is assumed to be generated if its contents // match the following regular expression: // // ^// Code generated .* DO NOT EDIT\\.$ // GeneratedFiles bool }
Exclusions define symbols and language elements that will be not checked
type Result ¶
type Result struct { // UnusedGetterError 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. UnusedGetterError []UnusedGetterError }
Result is returned from the CheckPackage function, and holds all the errors that were found to be unchecked in a package.
Aggregation can be done using the Append method for users that want to combine results from multiple packages.
type UnaryVisitor ¶
type UnaryVisitor struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.