mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
linting: apply errcheck part2
This commit is contained in:
committed by
Ethan Buchman
parent
57ea4987f7
commit
331857c9e6
@@ -65,7 +65,11 @@ func (cs *ConsensusState) ReplayFile(file string, console bool) error {
|
||||
}
|
||||
|
||||
pb := newPlayback(file, fp, cs, cs.state.Copy())
|
||||
defer pb.fp.Close()
|
||||
defer func() {
|
||||
if err := pb.fp.Close(); err != nil {
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
var nextN int // apply N msgs in a row
|
||||
var msg *TimedWALMessage
|
||||
@@ -127,7 +131,9 @@ func (pb *playback) replayReset(count int, newStepCh chan interface{}) error {
|
||||
newCS.SetEventBus(pb.cs.eventBus)
|
||||
newCS.startForReplay()
|
||||
|
||||
pb.fp.Close()
|
||||
if err := pb.fp.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
fp, err := os.OpenFile(pb.fileName, os.O_RDONLY, 0666)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -220,7 +226,9 @@ func (pb *playback) replayConsoleLoop() int {
|
||||
defer pb.cs.eventBus.Unsubscribe(ctx, subscriber, types.EventQueryNewRoundStep)
|
||||
|
||||
if len(tokens) == 1 {
|
||||
pb.replayReset(1, newStepCh)
|
||||
if err := pb.replayReset(1, newStepCh); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
i, err := strconv.Atoi(tokens[1])
|
||||
if err != nil {
|
||||
@@ -228,7 +236,9 @@ func (pb *playback) replayConsoleLoop() int {
|
||||
} else if i > pb.count {
|
||||
fmt.Printf("argument to back must not be larger than the current count (%d)\n", pb.count)
|
||||
} else {
|
||||
pb.replayReset(i, newStepCh)
|
||||
if err := pb.replayReset(i, newStepCh); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user