Documentation
¶
Index ¶
- Constants
- func AppendNoAssign(pass *analysis.Pass, node *ast.CallExpr, stack []ast.Node) (ds []analysis.Diagnostic)
- func GetCode(fset *token.FileSet, node any) (string, error)
- func GetCodeSafe(fset *token.FileSet, node any) string
- func GetFuncExprIdent(pass *analysis.Pass, e ast.Expr) *ast.Ident
- func GetFuncExprObject(pass *analysis.Pass, fn *ast.CallExpr) types.Object
- func GetFuncExprPkg(pass *analysis.Pass, e ast.Expr) *types.Package
- func GetIdentPkg(pass *analysis.Pass, ident *ast.Ident) *types.Package
- func IsBasicLit(node ast.Expr) bool
- func IsBasicType(typ types.Type) bool
- func IsBuiltinFunc(pass *analysis.Pass, fn *ast.CallExpr, name string) bool
- func IsCompositeLit(node ast.Expr) bool
- func IsConst(pass *analysis.Pass, e ast.Expr) bool
- func IsFuncPkg(pass *analysis.Pass, fn *ast.CallExpr, pkgPath string) bool
- func IsFuncType(pass *analysis.Pass, node *ast.CallExpr, fnType FuncType) bool
- func IsIdentNil(node ast.Expr) bool
- func IsTestFile(pass *analysis.Pass, node ast.Expr) bool
- func IsTupleAll(tp *types.Tuple, predict func(types.Type) bool) bool
- func IsType[T any](node ast.Expr) bool
- func IsVar(pass *analysis.Pass, e ast.Expr) bool
- func LintFuncResultUnused(pass *analysis.Pass, node *ast.CallExpr, stack []ast.Node) (ds []analysis.Diagnostic)
- func LintIterOverZero(pass *analysis.Pass, node *ast.RangeStmt, stack []ast.Node) (ds []analysis.Diagnostic)
- func LintRangeAppendAll(pass *analysis.Pass, node *ast.CallExpr, stack []ast.Node) (ds []analysis.Diagnostic)
- func LintTimeParseWrongArgsOrder(pass *analysis.Pass, node *ast.CallExpr) (ds []analysis.Diagnostic)
- func MustCompileOut(pass *analysis.Pass, node *ast.CallExpr, stack []ast.Node) (ds []analysis.Diagnostic)
- func NewAnalyzer(setting LinterSetting) (*analysis.Analyzer, error)
- type FuncType
- type LinterSetting
Constants ¶
View Source
const ( LinterName = "sundrylint" LinterDesc = "" /* 138-byte string literal not displayed */ SubLinterTimeparse = `timeparse` SubLinterIteroverzero = `iteroverzero` SubLinterFuncresultunused = `funcresultunused` SubLinterRangeappendall = `rangeappendall` SubLinterRangeappendallMessage = `append all its data while range it` SubLinterAppendNoAssignMessage = `call strconv.AppendX but not keep func result` SubLinterMustCompileOutMessage = `call regexp.MustCompile with constant should be moved out of func` )
View Source
const TimeParseLintMessage = "call func time.Parse may have incorrect args order, potentially swapping the layout and value arguments."
Variables ¶
This section is empty.
Functions ¶
func AppendNoAssign ¶
func IsBasicLit ¶
func IsBasicType ¶
func IsCompositeLit ¶
func IsIdentNil ¶
func LintFuncResultUnused ¶
func LintIterOverZero ¶
func LintRangeAppendAll ¶
func MustCompileOut ¶
func NewAnalyzer ¶
func NewAnalyzer(setting LinterSetting) (*analysis.Analyzer, error)
Types ¶
type LinterSetting ¶
type LinterSetting struct{}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.