Documentation
¶
Overview ¶
Package lint provides the foundation for tools like staticcheck
Index ¶
- func DisplayPosition(fset *token.FileSet, p token.Pos) token.Position
- func FilterChecks(allChecks []string, checks []string) map[string]bool
- func FuncName(f *types.Func) string
- type Check
- type Checker
- type FileIgnore
- type Func
- type GlobIgnore
- type Ignore
- type Job
- type JobStat
- type LineIgnore
- type Linter
- type PerfStats
- type Pkg
- type Positioner
- type Problem
- type Program
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileIgnore ¶
func (*FileIgnore) Match ¶
func (fi *FileIgnore) Match(p Problem) bool
type GlobIgnore ¶
func (*GlobIgnore) Match ¶
func (gi *GlobIgnore) Match(p Problem) bool
type Job ¶
type LineIgnore ¶
type LineIgnore struct { File string Line int Checks []string // contains filtered or unexported fields }
func (*LineIgnore) Match ¶
func (li *LineIgnore) Match(p Problem) bool
func (*LineIgnore) String ¶
func (li *LineIgnore) String() string
type Linter ¶
type Linter struct { Checkers []Checker Ignores []Ignore GoVersion int ReturnIgnored bool Config config.Config MaxConcurrentJobs int PrintStats bool // contains filtered or unexported fields }
A Linter lints Go source code.
type PerfStats ¶
type Pkg ¶
type Pkg struct { SSA *ssa.Package InitialFunctions []*ssa.Function *packages.Package Config config.Config Inspector *inspector.Inspector // TODO(dh): this map should probably map from *ast.File, not string Generated map[string]bool // contains filtered or unexported fields }
Pkg represents a package being linted.
type Positioner ¶
type Problem ¶
type Problem struct { Position token.Position // position in source file Text string // the prose that describes the problem Check string Package *Pkg Severity Severity }
Problem represents a problem in some source code.
Directories
¶
Path | Synopsis |
---|---|
Package lintdsl provides helpers for implementing static analysis checks.
|
Package lintdsl provides helpers for implementing static analysis checks. |
Package lintutil provides helpers for writing linter command lines.
|
Package lintutil provides helpers for writing linter command lines. |
format
Package format provides formatters for linter problems.
|
Package format provides formatters for linter problems. |
Package testutil provides helpers for testing staticcheck.
|
Package testutil provides helpers for testing staticcheck. |
Click to show internal directories.
Click to hide internal directories.