chore: staticcheck

This commit is contained in:
galargh 2024-08-05 19:51:38 +02:00 committed by Steven Allen
parent 8f56e8c97a
commit 097b4671b0
7 changed files with 8 additions and 11 deletions

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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)

View File

@ -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

View File

@ -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)
}

View File

@ -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"
)

View File

@ -17,6 +17,7 @@ import (
"github.com/libp2p/go-libp2p/core/peerstore"
"github.com/libp2p/go-libp2p/core/protocol"
//lint:ignore SA1019 "github.com/libp2p/go-msgio/protoio" is deprecated
"github.com/libp2p/go-msgio/protoio"
)