Skip to content

Commit

Permalink
Merge pull request #33 from libp2p/fix-lint-issues-pre-ci
Browse files Browse the repository at this point in the history
Address `go vet` and `saticcheck` issues
  • Loading branch information
Stebalien authored Jul 20, 2021
2 parents 191756f + 6ebf948 commit 9aed2da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions p2p/transport/testsuite/stream_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func goServe(t *testing.T, l transport.Listener) (done func()) {

func SubtestStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID, opt Options) {
msgsize := 1 << 11
errs := make(chan error, 0) // dont block anything.
errs := make(chan error) // dont block anything.

rateLimitN := 5000 // max of 5k funcs, because -race has 8k max.
rateLimitChan := make(chan struct{}, rateLimitN)
Expand Down Expand Up @@ -211,7 +211,7 @@ func SubtestStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr,

s, err := c.OpenStream(context.Background())
if err != nil {
errs <- fmt.Errorf("Failed to create NewStream: %s", err)
errs <- fmt.Errorf("failed to create NewStream: %s", err)
return
}

Expand Down
10 changes: 2 additions & 8 deletions p2p/transport/testsuite/transport_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"sync"
"testing"

"github.com/libp2p/go-libp2p-core/mux"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/transport"

Expand All @@ -17,11 +16,6 @@ import (

var testData = []byte("this is some test data")

type streamAndConn struct {
stream mux.MuxedStream
conn transport.CapableConn
}

func SubtestProtocols(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr, peerA peer.ID) {
rawIPAddr, _ := ma.NewMultiaddr("/ip4/1.2.3.4")
if ta.CanDial(rawIPAddr) || tb.CanDial(rawIPAddr) {
Expand Down Expand Up @@ -271,7 +265,7 @@ func SubtestPingPong(t *testing.T, ta, tb transport.Transport, maddr ma.Multiadd
return
}
if err = s.CloseWrite(); err != nil {
t.Fatal(err)
t.Error(err)
return
}

Expand All @@ -286,7 +280,7 @@ func SubtestPingPong(t *testing.T, ta, tb transport.Transport, maddr ma.Multiadd
}

if err = s.Close(); err != nil {
t.Fatal(err)
t.Error(err)
return
}
}(i)
Expand Down

0 comments on commit 9aed2da

Please sign in to comment.