File tree Expand file tree Collapse file tree 2 files changed +27
-319
lines changed Expand file tree Collapse file tree 2 files changed +27
-319
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,33 @@ var Analyzer = &analysis.Analyzer{
2020Run : runAnalyze ,
2121}
2222
23+ var (
24+ // WrapperFuncList contains "path/to/pkg.Funcname" strings that adds a context to errors.
25+ WrapperFuncList = []string {
26+ // stdlibs
27+ "errors.New" ,
28+ "fmt.Errorf" ,
29+
30+ // github.com/pkg/errors
31+ "github.com/pkg/errors.Errorf" ,
32+ "github.com/pkg/errors.New" ,
33+ "github.com/pkg/errors.WithMessage" ,
34+ "github.com/pkg/errors.WithStack" ,
35+ "github.com/pkg/errors.Wrap" ,
36+ "github.com/pkg/errors.Wrapf" ,
37+
38+ // github.com/srvc/fail
39+ "github.com/srvc/fail.Errorf" ,
40+ "github.com/srvc/fail.New" ,
41+ "github.com/srvc/fail.Wrap" ,
42+ }
43+ )
44+
45+ type errIdent struct {
46+ * ast.Ident
47+ wrapped bool
48+ }
49+
2350var wrapperFuncSet map [string ]struct {}
2451
2552func init () {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments