Skip to content

Commit

Permalink
chore: staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh authored and Stebalien committed Aug 6, 2024
1 parent 8f56e8c commit 097b467
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions floodsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
1 change: 1 addition & 0 deletions gossipsub_spam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
9 changes: 3 additions & 6 deletions gossipsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions timecache/time_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
1 change: 1 addition & 0 deletions tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down

0 comments on commit 097b467

Please sign in to comment.