errconst

package module
v0.2.4 Latest Latest
Warning

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

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

README

Documentation

Overview

Package errconst provides a go/analysis analyzer enforcing the gomatic Go standard that errors are sentinel constants (errs.Const), never created with errors.New or fmt.Errorf — fmt.Errorf is permitted only to wrap a cause with %w.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "errconst",
	Doc:      "reports errors.New and non-wrapping fmt.Errorf, which the gomatic Go standard forbids",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

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