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
p2p
go-p2p-discovery
Commits
f39b445c
Unverified
Commit
f39b445c
authored
May 19, 2021
by
Marten Seemann
Committed by
GitHub
May 19, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70 from libp2p/fix-staticcheck
fix staticcheck
parents
e2618ed1
077a3bc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
13 deletions
+2
-13
backoffcache_test.go
backoffcache_test.go
+2
-2
mocks_test.go
mocks_test.go
+0
-11
No files found.
backoffcache_test.go
View file @
f39b445c
...
...
@@ -172,7 +172,7 @@ func TestBackoffDiscoverySimultaneousQuery(t *testing.T) {
t
.
Fatal
(
err
)
}
_
=
<-
ch1
<-
ch1
ch2
,
err
:=
dCache
.
FindPeers
(
ctx
,
ns
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
@@ -185,7 +185,7 @@ func TestBackoffDiscoverySimultaneousQuery(t *testing.T) {
}
szCh1
:=
1
for
_
=
range
ch1
{
for
range
ch1
{
szCh1
++
}
...
...
mocks_test.go
View file @
f39b445c
...
...
@@ -75,17 +75,6 @@ func (s *mockDiscoveryServer) FindPeers(ns string, limit int) (<-chan peer.AddrI
return
ch
,
nil
}
func
(
s
*
mockDiscoveryServer
)
hasPeerRecord
(
ns
string
,
pid
peer
.
ID
)
bool
{
s
.
mx
.
Lock
()
defer
s
.
mx
.
Unlock
()
if
peers
,
ok
:=
s
.
db
[
ns
];
ok
{
_
,
ok
:=
peers
[
pid
]
return
ok
}
return
false
}
type
mockDiscoveryClient
struct
{
host
host
.
Host
server
*
mockDiscoveryServer
...
...
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