Skip to content

Commit

Permalink
chore: staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Aug 5, 2024
1 parent 84f49fb commit 5e81c24
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"

Check failure on line 25 in floodsub_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

"github.com/libp2p/go-msgio/protoio" is deprecated: GoGo Protobuf is deprecated and unmaintained. (SA1019)

Check failure on line 25 in floodsub_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

malformed linter directive; missing the required reason field? (compile)
)

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"

Check failure on line 19 in gossipsub_spam_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

"github.com/libp2p/go-msgio/protoio" is deprecated: GoGo Protobuf is deprecated and unmaintained. (SA1019)

Check failure on line 19 in gossipsub_spam_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

malformed linter directive; missing the required reason field? (compile)
)

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"

Check failure on line 24 in gossipsub_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

"github.com/libp2p/go-msgio/protoio" is deprecated: GoGo Protobuf is deprecated and unmaintained. (SA1019)

Check failure on line 24 in gossipsub_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

malformed linter directive; missing the required reason field? (compile)
)

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"

Check failure on line 21 in trace_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

"github.com/libp2p/go-msgio/protoio" is deprecated: GoGo Protobuf is deprecated and unmaintained. (SA1019)

Check failure on line 21 in trace_test.go

View workflow job for this annotation

GitHub Actions / go-check / All

malformed linter directive; missing the required reason field? (compile)
)

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"

Check failure on line 21 in tracer.go

View workflow job for this annotation

GitHub Actions / go-check / All

"github.com/libp2p/go-msgio/protoio" is deprecated: GoGo Protobuf is deprecated and unmaintained. (SA1019)

Check failure on line 21 in tracer.go

View workflow job for this annotation

GitHub Actions / go-check / All

malformed linter directive; missing the required reason field? (compile)
)

Expand Down

0 comments on commit 5e81c24

Please sign in to comment.