Commit 179650d3 authored by Steven Allen's avatar Steven Allen

fix: update to go 1.15 lint warnings

parent 7ca6d63b
...@@ -2,6 +2,7 @@ package sessionmanager ...@@ -2,6 +2,7 @@ package sessionmanager
import ( import (
"context" "context"
"fmt"
"sync" "sync"
"testing" "testing"
"time" "time"
...@@ -118,7 +119,7 @@ func TestReceiveFrom(t *testing.T) { ...@@ -118,7 +119,7 @@ func TestReceiveFrom(t *testing.T) {
pm := &fakePeerManager{} pm := &fakePeerManager{}
sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "") sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "")
p := peer.ID(123) p := peer.ID(fmt.Sprint(123))
block := blocks.NewBlock([]byte("block")) block := blocks.NewBlock([]byte("block"))
firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession) firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession)
...@@ -165,7 +166,7 @@ func TestReceiveBlocksWhenManagerShutdown(t *testing.T) { ...@@ -165,7 +166,7 @@ func TestReceiveBlocksWhenManagerShutdown(t *testing.T) {
pm := &fakePeerManager{} pm := &fakePeerManager{}
sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "") sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "")
p := peer.ID(123) p := peer.ID(fmt.Sprint(123))
block := blocks.NewBlock([]byte("block")) block := blocks.NewBlock([]byte("block"))
firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession) firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession)
...@@ -199,7 +200,7 @@ func TestReceiveBlocksWhenSessionContextCancelled(t *testing.T) { ...@@ -199,7 +200,7 @@ func TestReceiveBlocksWhenSessionContextCancelled(t *testing.T) {
pm := &fakePeerManager{} pm := &fakePeerManager{}
sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "") sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "")
p := peer.ID(123) p := peer.ID(fmt.Sprint(123))
block := blocks.NewBlock([]byte("block")) block := blocks.NewBlock([]byte("block"))
firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession) firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession)
...@@ -235,7 +236,7 @@ func TestShutdown(t *testing.T) { ...@@ -235,7 +236,7 @@ func TestShutdown(t *testing.T) {
pm := &fakePeerManager{} pm := &fakePeerManager{}
sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "") sm := New(ctx, sessionFactory, sim, peerManagerFactory, bpm, pm, notif, "")
p := peer.ID(123) p := peer.ID(fmt.Sprint(123))
block := blocks.NewBlock([]byte("block")) block := blocks.NewBlock([]byte("block"))
cids := []cid.Cid{block.Cid()} cids := []cid.Cid{block.Cid()}
firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession) firstSession := sm.NewSession(ctx, time.Second, delay.Fixed(time.Minute)).(*fakeSession)
......
package testutil package testutil
import ( import (
"fmt"
"math/rand" "math/rand"
bsmsg "github.com/ipfs/go-bitswap/message" bsmsg "github.com/ipfs/go-bitswap/message"
...@@ -59,7 +60,7 @@ func GeneratePeers(n int) []peer.ID { ...@@ -59,7 +60,7 @@ func GeneratePeers(n int) []peer.ID {
peerIds := make([]peer.ID, 0, n) peerIds := make([]peer.ID, 0, n)
for i := 0; i < n; i++ { for i := 0; i < n; i++ {
peerSeq++ peerSeq++
p := peer.ID(peerSeq) p := peer.ID(fmt.Sprint(i))
peerIds = append(peerIds, p) peerIds = append(peerIds, p)
} }
return peerIds return peerIds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment