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-kbucket
Commits
aa3a77e6
Commit
aa3a77e6
authored
Jun 15, 2021
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix staticcheck
parent
b52b1325
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
17 deletions
+4
-17
peerdiversity/filter_test.go
peerdiversity/filter_test.go
+4
-17
No files found.
peerdiversity/filter_test.go
View file @
aa3a77e6
...
@@ -76,12 +76,7 @@ func TestDiversityFilter(t *testing.T) {
...
@@ -76,12 +76,7 @@ func TestDiversityFilter(t *testing.T) {
m
.
peerAddressFunc
=
func
(
id
peer
.
ID
)
[]
ma
.
Multiaddr
{
m
.
peerAddressFunc
=
func
(
id
peer
.
ID
)
[]
ma
.
Multiaddr
{
return
[]
ma
.
Multiaddr
{
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
)}
return
[]
ma
.
Multiaddr
{
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
)}
}
}
m
.
allowFnc
=
func
(
g
PeerGroupInfo
)
bool
{
m
.
allowFnc
=
func
(
g
PeerGroupInfo
)
bool
{
return
g
.
Id
==
"p1"
}
if
g
.
Id
==
"p1"
{
return
true
}
return
false
}
},
},
allowed
:
map
[
peer
.
ID
]
bool
{
allowed
:
map
[
peer
.
ID
]
bool
{
"p1"
:
true
,
"p1"
:
true
,
...
@@ -99,19 +94,11 @@ func TestDiversityFilter(t *testing.T) {
...
@@ -99,19 +94,11 @@ func TestDiversityFilter(t *testing.T) {
if
id
==
"p1"
{
if
id
==
"p1"
{
return
[]
ma
.
Multiaddr
{
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
),
return
[]
ma
.
Multiaddr
{
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
),
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
)}
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
)}
}
else
{
return
[]
ma
.
Multiaddr
{
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
),
ma
.
StringCast
(
"/ip4/192.168.1.1/tcp/0"
)}
}
}
return
[]
ma
.
Multiaddr
{
ma
.
StringCast
(
"/ip4/127.0.0.1/tcp/0"
),
}
ma
.
StringCast
(
"/ip4/192.168.1.1/tcp/0"
)}
m
.
allowFnc
=
func
(
g
PeerGroupInfo
)
bool
{
if
g
.
IPGroupKey
==
"127.0.0.0"
{
return
true
}
return
false
}
}
m
.
allowFnc
=
func
(
g
PeerGroupInfo
)
bool
{
return
g
.
IPGroupKey
==
"127.0.0.0"
}
},
},
allowed
:
map
[
peer
.
ID
]
bool
{
allowed
:
map
[
peer
.
ID
]
bool
{
"p1"
:
true
,
"p1"
:
true
,
...
...
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