lint: add errchecks (#5316)

## Description

Work towards enabling errcheck

ref #5059
This commit is contained in:
Marko
2020-09-04 11:58:03 +00:00
committed by GitHub
parent 59ec3d91e4
commit b8d08b9ef4
43 changed files with 420 additions and 143 deletions
+6 -2
View File
@@ -20,7 +20,9 @@ func TestMockReporter(t *testing.T) {
}
badMessage := bh.BadMessage(peerID, "bad message")
pr.Report(badMessage)
if err := pr.Report(badMessage); err != nil {
t.Error(err)
}
behaviours = pr.GetBehaviours(peerID)
if len(behaviours) != 1 {
t.Error("Expected the peer have one reported behaviour")
@@ -164,7 +166,9 @@ func TestMockPeerBehaviourReporterConcurrency(t *testing.T) {
for {
select {
case pb := <-scriptItems:
pr.Report(pb.behaviour)
if err := pr.Report(pb.behaviour); err != nil {
t.Error(err)
}
case <-done:
return
}