Skip to content

Commit c68c7e3

Browse files
committed
chore: get rid of xerrors
go 1.14 is now required anyways
1 parent 1d4cb57 commit c68c7e3

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

dht.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/libp2p/go-libp2p-core/routing"
1717

1818
"go.opencensus.io/tag"
19-
"golang.org/x/xerrors"
2019

2120
"github.com/libp2p/go-libp2p-kad-dht/metrics"
2221
opts "github.com/libp2p/go-libp2p-kad-dht/opts"
@@ -482,10 +481,10 @@ func (dht *IpfsDHT) Ping(ctx context.Context, p peer.ID) error {
482481
req := pb.NewMessage(pb.Message_PING, nil, 0)
483482
resp, err := dht.sendRequest(ctx, p, req)
484483
if err != nil {
485-
return xerrors.Errorf("sending request: %w", err)
484+
return fmt.Errorf("sending request: %w", err)
486485
}
487486
if resp.Type != pb.Message_PING {
488-
return xerrors.Errorf("got unexpected response type: %v", resp.Type)
487+
return fmt.Errorf("got unexpected response type: %v", resp.Type)
489488
}
490489
return nil
491490
}

dht_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import (
1919
"github.com/multiformats/go-multihash"
2020
"github.com/multiformats/go-multistream"
2121

22-
"golang.org/x/xerrors"
23-
2422
"github.com/stretchr/testify/assert"
2523
"github.com/stretchr/testify/require"
2624

@@ -1755,5 +1753,5 @@ func TestClientModeAtInit(t *testing.T) {
17551753
client := setupDHT(ctx, t, true)
17561754
pinger.Host().Peerstore().AddAddrs(client.PeerID(), client.Host().Addrs(), peerstore.AddressTTL)
17571755
err := pinger.Ping(context.Background(), client.PeerID())
1758-
assert.True(t, xerrors.Is(err, multistream.ErrNotSupported))
1756+
assert.True(t, errors.Is(err, multistream.ErrNotSupported))
17591757
}

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ require (
2929
github.com/multiformats/go-multistream v0.1.1
3030
github.com/stretchr/testify v1.5.1
3131
go.opencensus.io v0.22.3
32-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
3332
)

go.sum

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,8 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm
538538
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
539539
golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ=
540540
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
541+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
541542
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
542-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
543-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
544543
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
545544
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
546545
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=

0 commit comments

Comments
 (0)