Skip to content

Commit

Permalink
Address lint issues as a result of libp2p deprecations and tidy go mod
Browse files Browse the repository at this point in the history
Address staticcheck issues caused by deprecated APIs and `go mod tidy`.
  • Loading branch information
masih committed Jun 29, 2022
1 parent 7c6d908 commit 9af69d1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ require (
github.com/libp2p/go-libp2p v0.20.1
github.com/libp2p/go-libp2p-connmgr v0.3.1
github.com/libp2p/go-libp2p-core v0.16.1
github.com/libp2p/go-libp2p-discovery v0.7.0
github.com/libp2p/go-libp2p-kad-dht v0.15.0
github.com/libp2p/go-libp2p-noise v0.4.0
github.com/libp2p/go-libp2p-peerstore v0.7.0
Expand All @@ -122,7 +121,6 @@ require (
github.com/libp2p/go-libp2p-record v0.1.3
github.com/libp2p/go-libp2p-resource-manager v0.3.0
github.com/libp2p/go-libp2p-routing-helpers v0.2.3
github.com/libp2p/go-libp2p-swarm v0.11.0
github.com/libp2p/go-libp2p-tls v0.4.1
github.com/libp2p/go-libp2p-yamux v0.9.1
github.com/libp2p/go-maddr-filter v0.1.0
Expand Down Expand Up @@ -261,9 +259,11 @@ require (
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.0.3 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-libp2p-discovery v0.7.0 // indirect
github.com/libp2p/go-libp2p-gostream v0.3.1 // indirect
github.com/libp2p/go-libp2p-kbucket v0.4.7 // indirect
github.com/libp2p/go-libp2p-loggables v0.1.0 // indirect
github.com/libp2p/go-libp2p-swarm v0.11.0 // indirect
github.com/libp2p/go-msgio v0.2.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-netroute v0.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion node/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func FromFile(path string, def interface{}) (interface{}, error) {
// FromReader loads config from a reader instance.
func FromReader(reader io.Reader, def interface{}) (interface{}, error) {
cfg := def
_, err := toml.DecodeReader(reader, cfg)
_, err := toml.NewDecoder(reader).Decode(cfg)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion node/impl/net/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
swarm "github.com/libp2p/go-libp2p-swarm"
basichost "github.com/libp2p/go-libp2p/p2p/host/basic"
"github.com/libp2p/go-libp2p/p2p/net/conngater"
"github.com/libp2p/go-libp2p/p2p/net/swarm"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
ma "github.com/multiformats/go-multiaddr"
"go.uber.org/fx"
Expand Down
4 changes: 2 additions & 2 deletions node/modules/lp2p/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/libp2p/go-libp2p"
coredisc "github.com/libp2p/go-libp2p-core/discovery"
"github.com/libp2p/go-libp2p-core/routing"
discovery "github.com/libp2p/go-libp2p-discovery"
routingdisc "github.com/libp2p/go-libp2p/p2p/discovery/routing"
)

func NoRelay() func() (opts Libp2pOpts, err error) {
Expand All @@ -24,5 +24,5 @@ func Discovery(router BaseIpfsRouting) (coredisc.Discovery, error) {
return nil, fmt.Errorf("no suitable routing for discovery")
}

return discovery.NewRoutingDiscovery(crouter), nil
return routingdisc.NewRoutingDiscovery(crouter), nil
}

0 comments on commit 9af69d1

Please sign in to comment.