mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-25 17:34:36 +00:00
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:
+1
-1
@@ -128,7 +128,7 @@ func (cs *State) catchupReplay(csHeight int64) error {
|
||||
if !found {
|
||||
return fmt.Errorf("cannot replay height %d. WAL does not contain #ENDHEIGHT for %d", csHeight, csHeight-1)
|
||||
}
|
||||
defer gr.Close() // nolint: errcheck
|
||||
defer gr.Close()
|
||||
|
||||
cs.Logger.Info("Catchup by replaying consensus messages", "height", csHeight)
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ func (cs *State) ReplayFile(file string, console bool) error {
|
||||
}
|
||||
|
||||
pb := newPlayback(file, fp, cs, cs.state.Copy())
|
||||
defer pb.fp.Close() // nolint: errcheck
|
||||
defer pb.fp.Close()
|
||||
|
||||
var nextN int // apply N msgs in a row
|
||||
var msg *TimedWALMessage
|
||||
|
||||
@@ -1002,7 +1002,7 @@ func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) {
|
||||
if !found {
|
||||
return nil, nil, fmt.Errorf("wal does not contain height %d", height)
|
||||
}
|
||||
defer gr.Close() // nolint: errcheck
|
||||
defer gr.Close()
|
||||
|
||||
// log.Notice("Build a blockchain by reading from the WAL")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user