Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
179650d3
Commit
179650d3
authored
4 years ago
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update to go 1.15 lint warnings
parent
7ca6d63b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
internal/sessionmanager/sessionmanager_test.go
internal/sessionmanager/sessionmanager_test.go
+5
-4
internal/testutil/testutil.go
internal/testutil/testutil.go
+2
-1
No files found.
internal/sessionmanager/sessionmanager_test.go
View file @
179650d3
...
...
@@ -2,6 +2,7 @@ package sessionmanager
import
(
"context"
"fmt"
"sync"
"testing"
"time"
...
...
@@ -118,7 +119,7 @@ func TestReceiveFrom(t *testing.T) {
pm
:=
&
fakePeerManager
{}
sm
:=
New
(
ctx
,
sessionFactory
,
sim
,
peerManagerFactory
,
bpm
,
pm
,
notif
,
""
)
p
:=
peer
.
ID
(
123
)
p
:=
peer
.
ID
(
fmt
.
Sprint
(
123
)
)
block
:=
blocks
.
NewBlock
([]
byte
(
"block"
))
firstSession
:=
sm
.
NewSession
(
ctx
,
time
.
Second
,
delay
.
Fixed
(
time
.
Minute
))
.
(
*
fakeSession
)
...
...
@@ -165,7 +166,7 @@ func TestReceiveBlocksWhenManagerShutdown(t *testing.T) {
pm
:=
&
fakePeerManager
{}
sm
:=
New
(
ctx
,
sessionFactory
,
sim
,
peerManagerFactory
,
bpm
,
pm
,
notif
,
""
)
p
:=
peer
.
ID
(
123
)
p
:=
peer
.
ID
(
fmt
.
Sprint
(
123
)
)
block
:=
blocks
.
NewBlock
([]
byte
(
"block"
))
firstSession
:=
sm
.
NewSession
(
ctx
,
time
.
Second
,
delay
.
Fixed
(
time
.
Minute
))
.
(
*
fakeSession
)
...
...
@@ -199,7 +200,7 @@ func TestReceiveBlocksWhenSessionContextCancelled(t *testing.T) {
pm
:=
&
fakePeerManager
{}
sm
:=
New
(
ctx
,
sessionFactory
,
sim
,
peerManagerFactory
,
bpm
,
pm
,
notif
,
""
)
p
:=
peer
.
ID
(
123
)
p
:=
peer
.
ID
(
fmt
.
Sprint
(
123
)
)
block
:=
blocks
.
NewBlock
([]
byte
(
"block"
))
firstSession
:=
sm
.
NewSession
(
ctx
,
time
.
Second
,
delay
.
Fixed
(
time
.
Minute
))
.
(
*
fakeSession
)
...
...
@@ -235,7 +236,7 @@ func TestShutdown(t *testing.T) {
pm
:=
&
fakePeerManager
{}
sm
:=
New
(
ctx
,
sessionFactory
,
sim
,
peerManagerFactory
,
bpm
,
pm
,
notif
,
""
)
p
:=
peer
.
ID
(
123
)
p
:=
peer
.
ID
(
fmt
.
Sprint
(
123
)
)
block
:=
blocks
.
NewBlock
([]
byte
(
"block"
))
cids
:=
[]
cid
.
Cid
{
block
.
Cid
()}
firstSession
:=
sm
.
NewSession
(
ctx
,
time
.
Second
,
delay
.
Fixed
(
time
.
Minute
))
.
(
*
fakeSession
)
...
...
This diff is collapsed.
Click to expand it.
internal/testutil/testutil.go
View file @
179650d3
package
testutil
import
(
"fmt"
"math/rand"
bsmsg
"github.com/ipfs/go-bitswap/message"
...
...
@@ -59,7 +60,7 @@ func GeneratePeers(n int) []peer.ID {
peerIds
:=
make
([]
peer
.
ID
,
0
,
n
)
for
i
:=
0
;
i
<
n
;
i
++
{
peerSeq
++
p
:=
peer
.
ID
(
peerSeq
)
p
:=
peer
.
ID
(
fmt
.
Sprint
(
i
)
)
peerIds
=
append
(
peerIds
,
p
)
}
return
peerIds
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment