mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-21 14:46:15 +00:00
errors: formating cleanup (#7507)
This commit is contained in:
@@ -27,13 +27,13 @@ func main() {
|
||||
|
||||
f, err := os.Open(os.Args[1])
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to open WAL file: %v", err))
|
||||
panic(fmt.Errorf("failed to open WAL file: %w", err))
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
walFile, err := os.OpenFile(os.Args[2], os.O_EXCL|os.O_WRONLY|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to open WAL file: %v", err))
|
||||
panic(fmt.Errorf("failed to open WAL file: %w", err))
|
||||
}
|
||||
defer walFile.Close()
|
||||
|
||||
@@ -48,7 +48,7 @@ func main() {
|
||||
if err == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
panic(fmt.Errorf("failed to read file: %v", err))
|
||||
panic(fmt.Errorf("failed to read file: %w", err))
|
||||
}
|
||||
// ignore the ENDHEIGHT in json.File
|
||||
if strings.HasPrefix(string(msgJSON), "ENDHEIGHT") {
|
||||
@@ -58,12 +58,12 @@ func main() {
|
||||
var msg consensus.TimedWALMessage
|
||||
err = tmjson.Unmarshal(msgJSON, &msg)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to unmarshal json: %v", err))
|
||||
panic(fmt.Errorf("failed to unmarshal json: %w", err))
|
||||
}
|
||||
|
||||
err = dec.Encode(&msg)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to encode msg: %v", err))
|
||||
panic(fmt.Errorf("failed to encode msg: %w", err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ func main() {
|
||||
|
||||
f, err := os.Open(os.Args[1])
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to open WAL file: %v", err))
|
||||
panic(fmt.Errorf("failed to open WAL file: %w", err))
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
@@ -34,12 +34,12 @@ func main() {
|
||||
if err == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
panic(fmt.Errorf("failed to decode msg: %v", err))
|
||||
panic(fmt.Errorf("failed to decode msg: %w", err))
|
||||
}
|
||||
|
||||
json, err := tmjson.Marshal(msg)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to marshal msg: %v", err))
|
||||
panic(fmt.Errorf("failed to marshal msg: %w", err))
|
||||
}
|
||||
|
||||
_, err = os.Stdout.Write(json)
|
||||
|
||||
Reference in New Issue
Block a user