Remove github.com/pkg/errors and replace with std library version

This is possible now that we no longer support go1.12 and brings
rclone into line with standard practices in the Go world.

This also removes errors.New and errors.Errorf from lib/errors and
prefers the stdlib errors package over lib/errors.
This commit is contained in:
Nick Craig-Wood
2021-11-07 11:53:30 +00:00
parent 97328e5755
commit e43b5ce5e5
233 changed files with 1673 additions and 1695 deletions
+3 -3
View File
@@ -3,10 +3,10 @@ package about
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"github.com/pkg/errors"
"github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config/flags"
@@ -98,11 +98,11 @@ see complete list in [documentation](https://rclone.org/overview/#optional-featu
cmd.Run(false, false, command, func() error {
doAbout := f.Features().About
if doAbout == nil {
return errors.Errorf("%v doesn't support about", f)
return fmt.Errorf("%v doesn't support about", f)
}
u, err := doAbout(context.Background())
if err != nil {
return errors.Wrap(err, "About call failed")
return fmt.Errorf("About call failed: %w", err)
}
if u == nil {
return errors.New("nil usage returned")