Documentation ¶
Overview ¶
Package lint provides the foundation for tools like gosimple.
Index ¶
- func CallName(call *ssa.CallCommon) string
- func FilterDebug(instr []ssa.Instruction) []ssa.Instruction
- func IsBlank(id ast.Expr) bool
- func IsCallTo(call *ssa.CallCommon, name string) bool
- func IsExample(fn *ssa.Function) bool
- func IsGenerated(f *ast.File) bool
- func IsIdent(expr ast.Expr, ident string) bool
- func IsPointerLike(T types.Type) bool
- func IsZero(expr ast.Expr) bool
- func NodeFns(pkgs []*Pkg) map[ast.Node]*ssa.Function
- func Preamble(f *ast.File) string
- type Checker
- type FileIgnore
- type Func
- type GlobIgnore
- type Ignore
- type Job
- func (j *Job) BoolConst(expr ast.Expr) bool
- func (j *Job) Errorf(n Positioner, format string, args ...interface{}) *Problem
- func (j *Job) ExprToInt(expr ast.Expr) (int64, bool)
- func (j *Job) ExprToString(expr ast.Expr) (string, bool)
- func (j *Job) File(node Positioner) *ast.File
- func (j *Job) IsBoolConst(expr ast.Expr) bool
- func (j *Job) IsCallToAST(node ast.Node, name string) bool
- func (j *Job) IsCallToAnyAST(node ast.Node, names ...string) bool
- func (j *Job) IsGoVersion(minor int) bool
- func (j *Job) IsInMain(node Positioner) bool
- func (j *Job) IsInTest(node Positioner) bool
- func (j *Job) IsNil(expr ast.Expr) bool
- func (j *Job) NodePackage(node Positioner) *Pkg
- func (j *Job) Render(x interface{}) string
- func (j *Job) RenderArgs(args []ast.Expr) string
- type LineIgnore
- type Linter
- type Pkg
- type Positioner
- type Problem
- type Program
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallName ¶
func CallName(call *ssa.CallCommon) string
func FilterDebug ¶
func FilterDebug(instr []ssa.Instruction) []ssa.Instruction
func IsBlank ¶
isBlank returns whether id is the blank identifier "_". If id == nil, the answer is false.
func IsGenerated ¶
func IsPointerLike ¶
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 Job struct { Program *Program // contains filtered or unexported fields }
func (*Job) Errorf ¶
func (j *Job) Errorf(n Positioner, format string, args ...interface{}) *Problem
func (*Job) IsGoVersion ¶
func (*Job) IsInMain ¶
func (j *Job) IsInMain(node Positioner) bool
func (*Job) IsInTest ¶
func (j *Job) IsInTest(node Positioner) bool
func (*Job) NodePackage ¶
func (j *Job) NodePackage(node Positioner) *Pkg
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 { Checker Checker Ignores []Ignore GoVersion int ReturnIgnored bool // contains filtered or unexported fields }
A Linter lints Go source code.
type Positioner ¶
type Problem ¶
type Problem struct { Position token.Position // position in source file Text string // the prose that describes the problem Check string Checker string Package *types.Package Ignored bool // contains filtered or unexported fields }
Problem represents a problem in some source code.
Click to show internal directories.
Click to hide internal directories.