errconst

package module
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 7 Imported by: 0

README

Documentation

Overview

Package errconst provides a go/analysis analyzer banning every use of errors.New and fmt.Errorf — called directly or referenced as a value — in favor of the gomatic Go standard's sentinel error constants (errs.Const). Wrapping goes through errs.Const.With, so consumer code never touches fmt.Errorf at all; only exempt packages — always including the sentinel mechanism itself, github.com/gomatic/go-error — may. The analyzer is a denylist on those two constructors; enforcement that package-level var sentinels become constants is covered by the sibling globalvar analyzer.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = newAnalyzer()

Analyzer reports disallowed error construction.

View Source
var Registration = goyze.Registration{
	Name:       "errconst",
	Categories: []goyze.Category{"errors"},
	URL:        "https://docs.gomatic.dev/yze/errconst",
	Analyzer:   Analyzer,
}

Registration declares this analyzer to the yze framework.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
yze-go-errconst command
Command yze-go-errconst runs the errconst analyzer as a standalone go/analysis checker (text and -json output, and usable as a `go vet -vettool`).
Command yze-go-errconst runs the errconst analyzer as a standalone go/analysis checker (text and -json output, and usable as a `go vet -vettool`).

Jump to

Keyboard shortcuts

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