mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 12:53:09 +00:00
chore: staticcheck
This commit is contained in:
parent
8f56e8c97a
commit
097b4671b0
@ -21,6 +21,7 @@ import (
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"github.com/libp2p/go-libp2p/core/protocol"
|
||||
|
||||
//lint:ignore SA1019 "github.com/libp2p/go-msgio/protoio" is deprecated
|
||||
"github.com/libp2p/go-msgio/protoio"
|
||||
)
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import (
|
||||
|
||||
pb "github.com/libp2p/go-libp2p-pubsub/pb"
|
||||
|
||||
//lint:ignore SA1019 "github.com/libp2p/go-msgio/protoio" is deprecated
|
||||
"github.com/libp2p/go-msgio/protoio"
|
||||
)
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ import (
|
||||
"github.com/libp2p/go-libp2p/core/peerstore"
|
||||
"github.com/libp2p/go-libp2p/core/record"
|
||||
|
||||
//lint:ignore SA1019 "github.com/libp2p/go-msgio/protoio" is deprecated
|
||||
"github.com/libp2p/go-msgio/protoio"
|
||||
)
|
||||
|
||||
@ -1924,13 +1925,11 @@ func TestGossipSubLeaveTopic(t *testing.T) {
|
||||
connect(t, h[0], h[1])
|
||||
|
||||
// Join all peers
|
||||
var subs []*Subscription
|
||||
for _, ps := range psubs {
|
||||
sub, err := ps.Subscribe("test")
|
||||
_, err := ps.Subscribe("test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
subs = append(subs, sub)
|
||||
}
|
||||
|
||||
time.Sleep(time.Second)
|
||||
@ -2005,13 +2004,11 @@ func TestGossipSubJoinTopic(t *testing.T) {
|
||||
router0.backoff["test"] = peerMap
|
||||
|
||||
// Join all peers
|
||||
var subs []*Subscription
|
||||
for _, ps := range psubs {
|
||||
sub, err := ps.Subscribe("test")
|
||||
_, err := ps.Subscribe("test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
subs = append(subs, sub)
|
||||
}
|
||||
|
||||
time.Sleep(time.Second)
|
||||
|
||||
@ -2,12 +2,8 @@ package timecache
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
logger "github.com/ipfs/go-log/v2"
|
||||
)
|
||||
|
||||
var log = logger.Logger("pubsub/timecache")
|
||||
|
||||
// Stategy is the TimeCache expiration strategy to use.
|
||||
type Strategy uint8
|
||||
|
||||
|
||||
@ -743,7 +743,7 @@ func notifSubThenUnSub(ctx context.Context, t *testing.T, topics []*Topic) {
|
||||
}
|
||||
|
||||
// Wait for the unsubscribe messages to reach the primary peer
|
||||
for len(primaryTopic.ListPeers()) < 0 {
|
||||
for len(primaryTopic.ListPeers()) > 0 {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ import (
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"github.com/libp2p/go-libp2p/core/peerstore"
|
||||
|
||||
//lint:ignore SA1019 "github.com/libp2p/go-msgio/protoio" is deprecated
|
||||
"github.com/libp2p/go-msgio/protoio"
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user