mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-21 07:24:36 +00:00
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:
@@ -59,8 +59,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
err = group.Start()
|
||||
if err != nil {
|
||||
if err = group.Start(); err != nil {
|
||||
fmt.Printf("logjack couldn't start with file %v\n", headPath)
|
||||
os.Exit(1)
|
||||
}
|
||||
@@ -69,10 +68,11 @@ func main() {
|
||||
buf := make([]byte, readBufferSize)
|
||||
for {
|
||||
n, err := os.Stdin.Read(buf)
|
||||
group.Write(buf[:n])
|
||||
group.FlushAndSync()
|
||||
if err != nil {
|
||||
group.Stop()
|
||||
if err := group.Stop(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "logjack stopped with error %v\n", headPath)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err == io.EOF {
|
||||
os.Exit(0)
|
||||
} else {
|
||||
@@ -80,6 +80,15 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
_, err = group.Write(buf[:n])
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "logjack failed write with error %v\n", headPath)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := group.FlushAndSync(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "logjack flushsync fail with error %v\n", headPath)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user