mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 22:32:13 +00:00
chore: get rid of xerrors
go 1.14 is now required anyways
This commit is contained in:
parent
1d4cb57140
commit
c68c7e3fa5
5
dht.go
5
dht.go
@ -16,7 +16,6 @@ import (
|
||||
"github.com/libp2p/go-libp2p-core/routing"
|
||||
|
||||
"go.opencensus.io/tag"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/libp2p/go-libp2p-kad-dht/metrics"
|
||||
opts "github.com/libp2p/go-libp2p-kad-dht/opts"
|
||||
@ -482,10 +481,10 @@ func (dht *IpfsDHT) Ping(ctx context.Context, p peer.ID) error {
|
||||
req := pb.NewMessage(pb.Message_PING, nil, 0)
|
||||
resp, err := dht.sendRequest(ctx, p, req)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("sending request: %w", err)
|
||||
return fmt.Errorf("sending request: %w", err)
|
||||
}
|
||||
if resp.Type != pb.Message_PING {
|
||||
return xerrors.Errorf("got unexpected response type: %v", resp.Type)
|
||||
return fmt.Errorf("got unexpected response type: %v", resp.Type)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ import (
|
||||
"github.com/multiformats/go-multihash"
|
||||
"github.com/multiformats/go-multistream"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@ -1755,5 +1753,5 @@ func TestClientModeAtInit(t *testing.T) {
|
||||
client := setupDHT(ctx, t, true)
|
||||
pinger.Host().Peerstore().AddAddrs(client.PeerID(), client.Host().Addrs(), peerstore.AddressTTL)
|
||||
err := pinger.Ping(context.Background(), client.PeerID())
|
||||
assert.True(t, xerrors.Is(err, multistream.ErrNotSupported))
|
||||
assert.True(t, errors.Is(err, multistream.ErrNotSupported))
|
||||
}
|
||||
|
1
go.mod
1
go.mod
@ -29,5 +29,4 @@ require (
|
||||
github.com/multiformats/go-multistream v0.1.1
|
||||
github.com/stretchr/testify v1.5.1
|
||||
go.opencensus.io v0.22.3
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
|
||||
)
|
||||
|
3
go.sum
3
go.sum
@ -538,9 +538,8 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
|
Loading…
x
Reference in New Issue
Block a user