refactor: stop using github.com/pkg/errors (#10431)
Oleg Kovalov committed
May 26, 2024 at 13:04 UTC
75df4e8173608dcc3fceba1868e7df97b2612ce7
4 files changed
+5
-5
client/rpc/pin.go
+1
-1
@@ -3,6 +3,7 @@ package rpc
3
import (
4
"context"
5
"encoding/json"
6
+ "errors"
7
"io"
8
"strings"
9
@@ -10,7 +11,6 @@ import (
11
"github.com/ipfs/go-cid"
12
iface "github.com/ipfs/kubo/core/coreiface"
13
caopts "github.com/ipfs/kubo/core/coreiface/options"
13
- "github.com/pkg/errors"
14
)
15
16
type PinAPI HttpApi
core/commands/pubsub.go
+2
-2
@@ -2,6 +2,7 @@ package commands
2
3
import (
4
"context"
5
+ "errors"
6
"fmt"
7
"io"
8
"net/http"
@@ -9,7 +10,6 @@ import (
10
11
cmdenv "github.com/ipfs/kubo/core/commands/cmdenv"
12
mbase "github.com/multiformats/go-multibase"
12
- "github.com/pkg/errors"
13
14
cmds "github.com/ipfs/go-ipfs-cmds"
15
options "github.com/ipfs/kubo/core/coreiface/options"
@@ -351,7 +351,7 @@ func urlArgsDecoder(req *cmds.Request, env cmds.Environment) error {
351
for n, arg := range req.Arguments {
352
encoding, data, err := mbase.Decode(arg)
353
if err != nil {
354
- return errors.Wrap(err, "URL arg must be multibase encoded")
354
+ return fmt.Errorf("URL arg must be multibase encoded: %w", err)
355
}
356
357
// Enforce URL-safe encoding is used for data passed via URL arguments
core/node/helpers.go
+1
-1
@@ -2,9 +2,9 @@ package node
2
3
import (
4
"context"
5
+ "errors"
6
7
"github.com/jbenet/goprocess"
7
- "github.com/pkg/errors"
8
"go.uber.org/fx"
9
)
10
go.mod
+1
-1
@@ -65,7 +65,6 @@ require (
65
github.com/multiformats/go-multihash v0.2.3
66
github.com/opentracing/opentracing-go v1.2.0
67
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
68
- github.com/pkg/errors v0.9.1
68
github.com/prometheus/client_golang v1.19.1
69
github.com/stretchr/testify v1.9.0
70
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
@@ -197,6 +196,7 @@ require (
196
github.com/pion/transport/v2 v2.2.4 // indirect
197
github.com/pion/turn/v2 v2.1.4 // indirect
198
github.com/pion/webrtc/v3 v3.2.23 // indirect
199
+ github.com/pkg/errors v0.9.1 // indirect
200
github.com/pmezard/go-difflib v1.0.0 // indirect
201
github.com/polydawn/refmt v0.89.0 // indirect
202
github.com/prometheus/client_model v0.6.1 // indirect