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 <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Moritz Poldrack 2022-07-31 15:15:27 +02:00 committed by Robin Jarry
parent 978d35d356
commit 70bfcfef42
26 changed files with 163 additions and 158 deletions
commands/msg

View file

@ -85,7 +85,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
if strings.Contains(to, "@") {
tolist, err = mail.ParseAddressList(to)
if err != nil {
return fmt.Errorf("invalid to address(es): %v", err)
return fmt.Errorf("invalid to address(es): %w", err)
}
}
if len(tolist) > 0 {