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 ¶
var Analyzer = newAnalyzer()
Analyzer reports disallowed error construction.
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`). |