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:
@@ -2,6 +2,8 @@ package upstream
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"path"
|
||||
@@ -11,7 +13,6 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/cache"
|
||||
"github.com/rclone/rclone/fs/fspath"
|
||||
@@ -133,7 +134,7 @@ func (f *Fs) WrapEntry(e fs.DirEntry) (Entry, error) {
|
||||
case fs.Directory:
|
||||
return f.WrapDirectory(e.(fs.Directory)), nil
|
||||
default:
|
||||
return nil, errors.Errorf("unknown object type %T", e)
|
||||
return nil, fmt.Errorf("unknown object type %T", e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +336,7 @@ func (f *Fs) updateUsageCore(lock bool) error {
|
||||
usage, err := f.RootFs.Features().About(ctx)
|
||||
if err != nil {
|
||||
f.cacheUpdate = false
|
||||
if errors.Cause(err) == fs.ErrorDirNotFound {
|
||||
if errors.Is(err, fs.ErrorDirNotFound) {
|
||||
err = nil
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user