noerrorassert

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package noerrorassert implements rule G10 of the anti-slop rule set. The rule rejects a type assertion and a type switch on a value of the predeclared error type. A caller wraps an error, and the wrapper answers such a test with the wrong type. errors.As and errors.Is walk the wrap chain, so they answer the question the code asks.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "noerrorassert",
	Doc:      doc,
	URL:      "https://github.com/JacobJNilsson/anti-slop-go/blob/main/docs/spec/002-rules.md",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer is the G10 analyzer. Consumers get it through antislop.Analyzers().

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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