errwrap

package
v0.0.0-...-0f8ce4c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Doc = `` /* 584-byte string literal not displayed */

Doc documents this pass.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "errwrap",
	Doc:      Doc,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer checks for improperly wrapped errors.

View Source
var ErrorFnFormatStringIndex = map[string]int{
	"errors.New": -1,

	"github.com/pkg/errors.New":  -1,
	"github.com/pkg/errors.Wrap": -1,

	"fmt.Errorf": 0,

	"github.com/pkg/errors.Errorf": 0,
	"github.com/pkg/errors.Wrapf":  1,
}

ErrorFnFormatStringIndex contains functions that should be checked for improperly wrapped errors. The value is the index of the function parameter containing the format string. It is -1 if there is no format string parameter.

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