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:
@@ -6,8 +6,8 @@ package rc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/filter"
|
||||
)
|
||||
@@ -146,16 +146,16 @@ func rcOptionsSet(ctx context.Context, in Params) (out Params, err error) {
|
||||
for name, options := range in {
|
||||
current := optionBlock[name]
|
||||
if current == nil {
|
||||
return nil, errors.Errorf("unknown option block %q", name)
|
||||
return nil, fmt.Errorf("unknown option block %q", name)
|
||||
}
|
||||
err := Reshape(current, options)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to write options from block %q", name)
|
||||
return nil, fmt.Errorf("failed to write options from block %q: %w", name, err)
|
||||
}
|
||||
if reload := optionReload[name]; reload != nil {
|
||||
err = reload(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to reload options from block %q", name)
|
||||
return nil, fmt.Errorf("failed to reload options from block %q: %w", name, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user