From 142a2ce067ef4facc0dbcc1932d88c4999cc3895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Calvo?= <491695+jacalvo@users.noreply.github.com> Date: Sat, 4 Feb 2023 13:13:45 +0100 Subject: [PATCH] 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 --- README.md | 1 + wrapcheck/wrapcheck.go | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index d668c52..e97c07d 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ ignoreSigs: - .Errorf( - errors.New( - errors.Unwrap( +- errors.Join( - .Wrap( - .Wrapf( - .WithMessage( diff --git a/wrapcheck/wrapcheck.go b/wrapcheck/wrapcheck.go index ea36c3f..6da17bd 100644 --- a/wrapcheck/wrapcheck.go +++ b/wrapcheck/wrapcheck.go @@ -16,6 +16,7 @@ var DefaultIgnoreSigs = []string{ ".Errorf(", "errors.New(", "errors.Unwrap(", + "errors.Join(", ".Wrap(", ".Wrapf(", ".WithMessage(",