mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
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:
@@ -3,12 +3,12 @@ package config
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/config"
|
||||
@@ -398,11 +398,11 @@ To reconnect use "rclone config reconnect".
|
||||
f := cmd.NewFsSrc(args)
|
||||
doDisconnect := f.Features().Disconnect
|
||||
if doDisconnect == nil {
|
||||
return errors.Errorf("%v doesn't support Disconnect", f)
|
||||
return fmt.Errorf("%v doesn't support Disconnect", f)
|
||||
}
|
||||
err := doDisconnect(context.Background())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Disconnect call failed")
|
||||
return fmt.Errorf("Disconnect call failed: %w", err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
@@ -428,11 +428,11 @@ system.
|
||||
f := cmd.NewFsSrc(args)
|
||||
doUserInfo := f.Features().UserInfo
|
||||
if doUserInfo == nil {
|
||||
return errors.Errorf("%v doesn't support UserInfo", f)
|
||||
return fmt.Errorf("%v doesn't support UserInfo", f)
|
||||
}
|
||||
u, err := doUserInfo(context.Background())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "UserInfo call failed")
|
||||
return fmt.Errorf("UserInfo call failed: %w", err)
|
||||
}
|
||||
if jsonOutput {
|
||||
out := json.NewEncoder(os.Stdout)
|
||||
|
||||
Reference in New Issue
Block a user