mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +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:
@@ -3,8 +3,6 @@ package fs
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// CutoffMode describes the possible delete modes in the config
|
||||
@@ -40,7 +38,7 @@ func (m *CutoffMode) Set(s string) error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return errors.Errorf("Unknown cutoff mode %q", s)
|
||||
return fmt.Errorf("Unknown cutoff mode %q", s)
|
||||
}
|
||||
|
||||
// Type of the value
|
||||
@@ -52,7 +50,7 @@ func (m *CutoffMode) Type() string {
|
||||
func (m *CutoffMode) UnmarshalJSON(in []byte) error {
|
||||
return UnmarshalJSONFlag(in, m, func(i int64) error {
|
||||
if i < 0 || i >= int64(len(cutoffModeToString)) {
|
||||
return errors.Errorf("Out of range cutoff mode %d", i)
|
||||
return fmt.Errorf("Out of range cutoff mode %d", i)
|
||||
}
|
||||
*m = (CutoffMode)(i)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user