lint: errcheck (#5091)

## Description

add more error checks to tests


gonna do a third PR that tackles the non test cases
This commit is contained in:
Marko
2020-07-14 11:04:41 +00:00
committed by GitHub
parent 0825d57cf7
commit 6ccccb0933
32 changed files with 773 additions and 229 deletions
+10 -2
View File
@@ -63,7 +63,11 @@ func TestReactor_Receive_ChunkRequest(t *testing.T) {
r := NewReactor(conn, nil, "")
err := r.Start()
require.NoError(t, err)
defer r.Stop()
t.Cleanup(func() {
if err := r.Stop(); err != nil {
t.Error(err)
}
})
r.Receive(ChunkChannel, peer, mustEncodeMsg(tc.request))
time.Sleep(100 * time.Millisecond)
@@ -136,7 +140,11 @@ func TestReactor_Receive_SnapshotsRequest(t *testing.T) {
r := NewReactor(conn, nil, "")
err := r.Start()
require.NoError(t, err)
defer r.Stop()
t.Cleanup(func() {
if err := r.Stop(); err != nil {
t.Error(err)
}
})
r.Receive(SnapshotChannel, peer, mustEncodeMsg(&ssproto.SnapshotsRequest{}))
time.Sleep(100 * time.Millisecond)