From 70bfcfef42578079f211d87cddc49519ee3503dc Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Sun, 31 Jul 2022 15:15:27 +0200 Subject: lint: work nicely with wrapped errors (errorlint) Error wrapping as introduced in Go 1.13 adds some additional logic to use for comparing errors and adding information to it. Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- lib/crypto/gpg/gpgbin/encrypt.go | 2 +- lib/crypto/gpg/gpgbin/sign.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/crypto/gpg/gpgbin') diff --git a/lib/crypto/gpg/gpgbin/encrypt.go b/lib/crypto/gpg/gpgbin/encrypt.go index 9ca45269..79003fd5 100644 --- a/lib/crypto/gpg/gpgbin/encrypt.go +++ b/lib/crypto/gpg/gpgbin/encrypt.go @@ -33,7 +33,7 @@ func Encrypt(r io.Reader, to []string, from string) ([]byte, error) { var md models.MessageDetails err = parse(outRdr, &md) if err != nil { - return nil, fmt.Errorf("gpg: failure to encrypt: %v. check public key(s)", err) + return nil, fmt.Errorf("gpg: failure to encrypt: %w. check public key(s)", err) } var buf bytes.Buffer _, _ = io.Copy(&buf, md.Body) diff --git a/lib/crypto/gpg/gpgbin/sign.go b/lib/crypto/gpg/gpgbin/sign.go index caf31d14..314c3fc3 100644 --- a/lib/crypto/gpg/gpgbin/sign.go +++ b/lib/crypto/gpg/gpgbin/sign.go @@ -26,7 +26,7 @@ func Sign(r io.Reader, from string) ([]byte, string, error) { var md models.MessageDetails err = parse(outRdr, &md) if err != nil { - return nil, "", fmt.Errorf("failed to parse messagedetails: %v", err) + return nil, "", fmt.Errorf("failed to parse messagedetails: %w", err) } var buf bytes.Buffer _, _ = io.Copy(&buf, md.Body) -- cgit