Documentation ¶
Overview ¶
Package lintdsl provides helpers for implementing static analysis checks. Dot-importing this package is encouraged.
Index ¶
- func BoolConst(j *lint.Job, expr ast.Expr) bool
- func CallName(call *ssa.CallCommon) string
- func CallNameAST(j *lint.Job, call *ast.CallExpr) string
- func Dereference(T types.Type) types.Type
- func DereferenceR(T types.Type) types.Type
- func ExprToInt(j *lint.Job, expr ast.Expr) (int64, bool)
- func ExprToString(j *lint.Job, expr ast.Expr) (string, bool)
- func FilterDebug(instr []ssa.Instruction) []ssa.Instruction
- func GroupSpecs(fset *token.FileSet, specs []ast.Spec) [][]ast.Spec
- func Inspect(node ast.Node, fn func(node ast.Node) bool)
- func IsBlank(id ast.Expr) bool
- func IsBoolConst(j *lint.Job, expr ast.Expr) bool
- func IsCallTo(call *ssa.CallCommon, name string) bool
- func IsCallToAST(j *lint.Job, node ast.Node, name string) bool
- func IsCallToAnyAST(j *lint.Job, node ast.Node, names ...string) bool
- func IsExample(fn *ssa.Function) bool
- func IsGenerated(f *ast.File) bool
- func IsGoVersion(j *lint.Job, minor int) bool
- func IsIdent(expr ast.Expr, ident string) bool
- func IsInMain(j *lint.Job, node lint.Positioner) bool
- func IsInTest(j *lint.Job, node lint.Positioner) bool
- func IsIntLiteral(expr ast.Expr, literal string) bool
- func IsNil(j *lint.Job, expr ast.Expr) bool
- func IsObject(obj types.Object, name string) bool
- func IsOfType(j *lint.Job, expr ast.Expr, name string) bool
- func IsPointerLike(T types.Type) bool
- func IsType(T types.Type, name string) bool
- func IsZero(expr ast.Expr) booldeprecated
- func Preamble(f *ast.File) string
- func Render(j *lint.Job, x interface{}) string
- func RenderArgs(j *lint.Job, args []ast.Expr) string
- func SelectorName(j *lint.Job, expr *ast.SelectorExpr) string
- type Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallName ¶
func CallName(call *ssa.CallCommon) string
func Dereference ¶
Dereference returns a pointer's element type; otherwise it returns T.
func DereferenceR ¶
DereferenceR returns a pointer's element type; otherwise it returns T. If the element type is itself a pointer, DereferenceR will be applied recursively.
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 ¶
func SelectorName ¶
func SelectorName(j *lint.Job, expr *ast.SelectorExpr) string
Types ¶
Click to show internal directories.
Click to hide internal directories.