mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 10:33:34 +00: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:
@@ -4,11 +4,11 @@
|
||||
package mountlib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rclone/rclone/fs"
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
func CheckMountEmpty(mountpoint string) error {
|
||||
fp, err := os.Open(mountpoint)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "Can not open: %s", mountpoint)
|
||||
return fmt.Errorf("Can not open: %s: %w", mountpoint, err)
|
||||
}
|
||||
defer fs.CheckClose(fp, &err)
|
||||
|
||||
@@ -28,9 +28,9 @@ func CheckMountEmpty(mountpoint string) error {
|
||||
|
||||
const msg = "Directory is not empty, use --allow-non-empty to mount anyway: %s"
|
||||
if err == nil {
|
||||
return errors.Errorf(msg, mountpoint)
|
||||
return fmt.Errorf(msg, mountpoint)
|
||||
}
|
||||
return errors.Wrapf(err, msg, mountpoint)
|
||||
return fmt.Errorf(msg+": %w", mountpoint, err)
|
||||
}
|
||||
|
||||
// CheckMountReady should check if mountpoint is mounted by rclone.
|
||||
|
||||
Reference in New Issue
Block a user