errorlint

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT Imports: 10 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LintErrorComparisons

func LintErrorComparisons(info *TypesInfoExt) []analysis.Diagnostic

func LintErrorTypeAssertions

func LintErrorTypeAssertions(fset *token.FileSet, info *TypesInfoExt) []analysis.Diagnostic

func LintFmtErrorfCalls

func LintFmtErrorfCalls(fset *token.FileSet, info types.Info, multipleWraps bool) []analysis.Diagnostic

func NewAnalyzer

func NewAnalyzer(opts ...Option) *analysis.Analyzer

Types

type AllowPair added in v1.5.0

type AllowPair struct {
	Err string
	Fun string
}

type ByPosition

type ByPosition []analysis.Diagnostic

func (ByPosition) Len

func (l ByPosition) Len() int

func (ByPosition) Less

func (l ByPosition) Less(i, j int) bool

func (ByPosition) Swap

func (l ByPosition) Swap(i, j int)

type Option added in v1.5.0

type Option func()

func WithAllowedErrors added in v1.5.0

func WithAllowedErrors(ap []AllowPair) Option

func WithAllowedWildcard added in v1.5.0

func WithAllowedWildcard(ap []AllowPair) Option

type TypesInfoExt

type TypesInfoExt struct {
	*analysis.Pass

	// Maps AST nodes back to the node they are contained within.
	NodeParent map[ast.Node]ast.Node

	// Maps an object back to all identifiers to refer to it.
	IdentifiersForObject map[types.Object][]*ast.Ident
}

func (*TypesInfoExt) ContainingFuncDecl added in v1.0.3

func (info *TypesInfoExt) ContainingFuncDecl(node ast.Node) *ast.FuncDecl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL