Skip to content

Commit

Permalink
feat: ignore Go 1.20 errors.Join() sig by default (#37)
Browse files Browse the repository at this point in the history
After upgrading to Go 1.20 and using the new `errors.Join()` from the
standard library, there is a false positive from `wrapcheck` saying that
error returned from external package is unwrapped, when `errors.Join()`
is now supposed to be an idiomatic way to wrap multiple errors from
external packages.

More info in the Go 1.20 release notes:

https://tip.golang.org/doc/go1.20#errors
  • Loading branch information
jacalvo authored Feb 4, 2023
1 parent 36ebab6 commit 142a2ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ignoreSigs:
- .Errorf(
- errors.New(
- errors.Unwrap(
- errors.Join(
- .Wrap(
- .Wrapf(
- .WithMessage(
Expand Down
1 change: 1 addition & 0 deletions wrapcheck/wrapcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var DefaultIgnoreSigs = []string{
".Errorf(",
"errors.New(",
"errors.Unwrap(",
"errors.Join(",
".Wrap(",
".Wrapf(",
".WithMessage(",
Expand Down

0 comments on commit 142a2ce

Please sign in to comment.