linter: (1/2) enable errcheck (#5064)

## Description

partially cleanup in preparation for errcheck

i ignored a bunch of defer errors in tests but with the update to go 1.14 we can use `t.Cleanup(func() { if err := <>; err != nil {..}}` to cover those errors, I will do this in pr number two of enabling errcheck.

ref #5059
This commit is contained in:
Marko
2020-07-01 15:13:11 +00:00
committed by GitHub
parent 8ec8385427
commit 7e2cc1db5e
35 changed files with 289 additions and 200 deletions
+14 -6
View File
@@ -8,6 +8,7 @@ import (
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db"
@@ -146,8 +147,10 @@ func TestNoBlockResponse(t *testing.T) {
defer func() {
for _, r := range reactorPairs {
r.reactor.Stop()
r.app.Stop()
err := r.reactor.Stop()
require.NoError(t, err)
err = r.app.Stop()
require.NoError(t, err)
}
}()
@@ -195,8 +198,10 @@ func TestBadBlockStopsPeer(t *testing.T) {
otherChain := newBlockchainReactor(log.TestingLogger(), genDoc, privVals, maxBlockHeight)
defer func() {
otherChain.reactor.Stop()
otherChain.app.Stop()
err := otherChain.reactor.Stop()
require.Error(t, err)
err = otherChain.app.Stop()
require.NoError(t, err)
}()
reactorPairs := make([]BlockchainReactorPair, 4)
@@ -214,8 +219,11 @@ func TestBadBlockStopsPeer(t *testing.T) {
defer func() {
for _, r := range reactorPairs {
r.reactor.Stop()
r.app.Stop()
err := r.reactor.Stop()
require.NoError(t, err)
err = r.app.Stop()
require.NoError(t, err)
}
}()