Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
af895a81
Commit
af895a81
authored
7 years ago
by
Kevin Atkinson
Browse files
Options
Download
Email Patches
Plain Diff
Fix most "go vet" errors.
parent
9e3cf083
master
2018-Q4-OKR
feat/protobuf
feat/udp
fix/473
fix/no-custom-field
fix/reset-ping-stream
fix/revert-correct-external-addr
gx/update-jccl6u
gx/update-nza0mn
jenkinsfile
kevina/fix-go-vet
multistream-ping
punching
revert-276-update-go-detect-race
v6.0.23
v6.0.22
v6.0.21
v6.0.20
v6.0.19
v6.0.18
v6.0.17
v6.0.16
v6.0.15
v6.0.14
v6.0.13
v6.0.12
v6.0.11
v6.0.10
v6.0.9
v6.0.8
v6.0.7
v6.0.6
v6.0.5
v6.0.4
v6.0.3
v6.0.2
v6.0.1
v6.0.0
v5.0.21
v5.0.20
v5.0.19
v5.0.18
v5.0.17
v5.0.16
v5.0.15
v5.0.14
v5.0.13
v5.0.12
v5.0.11
v5.0.10
v5.0.9
v5.0.8
v5.0.7
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
p2p/host/basic/basic_host_test.go
+2
-2
p2p/host/basic/basic_host_test.go
p2p/net/mock/mock_peernet.go
+1
-1
p2p/net/mock/mock_peernet.go
p2p/net/mock/mock_test.go
+2
-2
p2p/net/mock/mock_test.go
p2p/test/backpressure/backpressure_test.go
+3
-3
p2p/test/backpressure/backpressure_test.go
p2p/test/reconnects/reconnect_test.go
+1
-1
p2p/test/reconnects/reconnect_test.go
with
9 additions
and
9 deletions
+9
-9
p2p/host/basic/basic_host_test.go
View file @
af895a81
...
...
@@ -54,7 +54,7 @@ func TestHostSimple(t *testing.T) {
t
.
Fatal
(
err
)
}
if
!
bytes
.
Equal
(
buf1
,
buf2
)
{
t
.
Fatal
(
"buf1 != buf2 -- %x != %x"
,
buf1
,
buf2
)
t
.
Fatal
f
(
"buf1 != buf2 -- %x != %x"
,
buf1
,
buf2
)
}
// get it from the pipe (tee)
...
...
@@ -63,7 +63,7 @@ func TestHostSimple(t *testing.T) {
t
.
Fatal
(
err
)
}
if
!
bytes
.
Equal
(
buf1
,
buf3
)
{
t
.
Fatal
(
"buf1 != buf3 -- %x != %x"
,
buf1
,
buf3
)
t
.
Fatal
f
(
"buf1 != buf3 -- %x != %x"
,
buf1
,
buf3
)
}
}
...
...
This diff is collapsed.
Click to expand it.
p2p/net/mock/mock_peernet.go
View file @
af895a81
...
...
@@ -205,7 +205,7 @@ func (pn *peernet) removeConn(c *conn) {
cs
,
found
=
pn
.
connsByPeer
[
c
.
remote
]
if
!
found
{
panic
(
fmt
.
Sprintf
(
"attempting to remove a conn that doesnt exist %
p
"
,
c
.
remote
))
panic
(
fmt
.
Sprintf
(
"attempting to remove a conn that doesnt exist %
v
"
,
c
.
remote
))
}
delete
(
cs
,
c
)
}
...
...
This diff is collapsed.
Click to expand it.
p2p/net/mock/mock_test.go
View file @
af895a81
...
...
@@ -166,7 +166,7 @@ func TestNetworkSetup(t *testing.T) {
links12
=
mn
.
LinksBetweenPeers
(
p1
,
p2
)
if
len
(
links12
)
!=
0
{
t
.
Error
f
(
"should be 0 now..."
,
len
(
links12
))
t
.
Error
(
"should be 0 now..."
,
len
(
links12
))
}
links11
=
mn
.
LinksBetweenPeers
(
p1
,
p1
)
...
...
@@ -190,7 +190,7 @@ func TestNetworkSetup(t *testing.T) {
// first, no conns
if
len
(
n2
.
Conns
())
>
0
||
len
(
n3
.
Conns
())
>
0
{
t
.
Error
(
"should have 0 conn. Got: (%d, %d)"
,
len
(
n2
.
Conns
()),
len
(
n3
.
Conns
()))
t
.
Error
f
(
"should have 0 conn. Got: (%d, %d)"
,
len
(
n2
.
Conns
()),
len
(
n3
.
Conns
()))
}
// connect p2->p3
...
...
This diff is collapsed.
Click to expand it.
p2p/test/backpressure/backpressure_test.go
View file @
af895a81
...
...
@@ -146,7 +146,7 @@ a problem.
h2pi
:=
h2
.
Peerstore
()
.
PeerInfo
(
h2
.
ID
())
log
.
Debugf
(
"dialing %s"
,
h2pi
.
Addrs
)
if
err
:=
h1
.
Connect
(
ctx
,
h2pi
);
err
!=
nil
{
t
.
Fatal
f
(
"Failed to connect:"
,
err
)
t
.
Fatal
(
"Failed to connect:"
,
err
)
}
// launch sender!
...
...
@@ -266,7 +266,7 @@ func TestStBackpressureStreamWrite(t *testing.T) {
t
.
Error
(
"read failed:"
,
err
)
}
if
expect
!=
n
{
t
.
Error
(
"read len differs: %d != %d"
,
expect
,
n
)
t
.
Error
f
(
"read len differs: %d != %d"
,
expect
,
n
)
}
}
...
...
@@ -283,7 +283,7 @@ func TestStBackpressureStreamWrite(t *testing.T) {
h2pi
:=
h2
.
Peerstore
()
.
PeerInfo
(
h2
.
ID
())
log
.
Debugf
(
"dialing %s"
,
h2pi
.
Addrs
)
if
err
:=
h1
.
Connect
(
ctx
,
h2pi
);
err
!=
nil
{
t
.
Fatal
f
(
"Failed to connect:"
,
err
)
t
.
Fatal
(
"Failed to connect:"
,
err
)
}
// open a stream, from 2->1, this is our reader
...
...
This diff is collapsed.
Click to expand it.
p2p/test/reconnects/reconnect_test.go
View file @
af895a81
...
...
@@ -174,7 +174,7 @@ func SubtestConnSendDisc(t *testing.T, hosts []host.Host) {
h2pi
:=
h2
.
Peerstore
()
.
PeerInfo
(
h2
.
ID
())
log
.
Debugf
(
"dialing %s"
,
h2pi
.
Addrs
)
if
err
:=
h1
.
Connect
(
ctx
,
h2pi
);
err
!=
nil
{
t
.
Fatal
f
(
"Failed to connect:"
,
err
)
t
.
Fatal
(
"Failed to connect:"
,
err
)
}
}
}
...
...
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
Menu
Projects
Groups
Snippets
Help