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 IsGenerated(f *ast.File) bool
- func IsIdent(expr ast.Expr, ident string) bool
- func IsZero(expr ast.Expr) bool
- func NodeFns(pkgs []*Pkg) map[ast.Node]*ssa.Function
- type Checker
- type Func
- type Ignore
- type Job
- func (j *Job) BoolConst(expr ast.Expr) bool
- func (j *Job) EnclosingSSAFunction(node Positioner) *ssa.Function
- 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) IsFunctionCallName(node ast.Node, name string) bool
- func (j *Job) IsFunctionCallNameAny(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) *ssa.Package
- func (j *Job) Render(x interface{}) string
- func (j *Job) RenderArgs(args []ast.Expr) string
- 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 ¶
Types ¶
type Job ¶
type Job struct { Program *Program // contains filtered or unexported fields }
func (*Job) EnclosingSSAFunction ¶
func (j *Job) EnclosingSSAFunction(node Positioner) *ssa.Function
func (*Job) Errorf ¶
func (j *Job) Errorf(n Positioner, format string, args ...interface{}) *Problem
func (*Job) IsFunctionCallNameAny ¶
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) *ssa.Package
type Pkg ¶
type Pkg struct { *ssa.Package Info *loader.PackageInfo }
Pkg represents a package being linted.
type Positioner ¶
Click to show internal directories.
Click to hide internal directories.