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:
@@ -8,13 +8,13 @@ package qingstor
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/md5"
|
||||
"errors"
|
||||
"fmt"
|
||||
"hash"
|
||||
"io"
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/lib/atexit"
|
||||
qs "github.com/yunify/qingstor-sdk-go/v3/service"
|
||||
@@ -175,7 +175,7 @@ func (u *uploader) upload() error {
|
||||
u.init()
|
||||
|
||||
if u.cfg.partSize < minMultiPartSize {
|
||||
return errors.Errorf("part size must be at least %d bytes", minMultiPartSize)
|
||||
return fmt.Errorf("part size must be at least %d bytes", minMultiPartSize)
|
||||
}
|
||||
|
||||
// Do one read to determine if we have more than one part
|
||||
@@ -184,7 +184,7 @@ func (u *uploader) upload() error {
|
||||
fs.Debugf(u, "Uploading as single part object to QingStor")
|
||||
return u.singlePartUpload(reader, u.readerPos)
|
||||
} else if err != nil {
|
||||
return errors.Errorf("read upload data failed: %s", err)
|
||||
return fmt.Errorf("read upload data failed: %s", err)
|
||||
}
|
||||
|
||||
fs.Debugf(u, "Uploading as multi-part object to QingStor")
|
||||
|
||||
Reference in New Issue
Block a user