Documentation
¶
Overview ¶
Package astutil provides shared AST/type helper functions used by linters.
Index ¶
- func Inspector(pass *analysis.Pass) (*inspector.Inspector, error)
- func IsFmtErrorf(pass *analysis.Pass, call *ast.CallExpr) bool
- func IsLocalObject(obj types.Object) bool
- func IsStringLiteral(expr ast.Expr) bool
- func NodeText(fset *token.FileSet, node ast.Node) string
- func RhsExprForIndex(rhs []ast.Expr, idx int) (ast.Expr, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Inspector ¶ added in v0.79.4
Inspector extracts the *inspector.Inspector from pass.ResultOf. It returns an error if the result has an unexpected type.
func IsFmtErrorf ¶
IsFmtErrorf reports whether call is a call to fmt.Errorf (including aliases).
func IsLocalObject ¶
IsLocalObject reports whether obj is a local (non-package-scope) object.
func IsStringLiteral ¶
IsStringLiteral reports whether expr is a string literal.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.