Skip to content

Commit 142a2ce

Browse files
authored
feat: ignore Go 1.20 errors.Join() sig by default (#37)
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
1 parent 36ebab6 commit 142a2ce

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ignoreSigs:
3333
- .Errorf(
3434
- errors.New(
3535
- errors.Unwrap(
36+
- errors.Join(
3637
- .Wrap(
3738
- .Wrapf(
3839
- .WithMessage(

wrapcheck/wrapcheck.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var DefaultIgnoreSigs = []string{
1616
".Errorf(",
1717
"errors.New(",
1818
"errors.Unwrap(",
19+
"errors.Join(",
1920
".Wrap(",
2021
".Wrapf(",
2122
".WithMessage(",

0 commit comments

Comments
 (0)