Address lint issues as a result of libp2p deprecations and tidy go mod
Address staticcheck issues caused by deprecated APIs and `go mod tidy`.
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user