Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: mojom/mojom_parser/fmt_cmd.go

Issue 1833493002: Replace ErrorExit with log.Fatal in the mojom tool. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/check_version.go ('k') | mojom/mojom_parser/mojom_main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/fmt_cmd.go
diff --git a/mojom/mojom_parser/fmt_cmd.go b/mojom/mojom_parser/fmt_cmd.go
index 5bfc24031ba4760549fce9a59a8e3131d099b198..ce75f1a88a24f08241e940b99ddbc0f53b9303cc 100644
--- a/mojom/mojom_parser/fmt_cmd.go
+++ b/mojom/mojom_parser/fmt_cmd.go
@@ -16,6 +16,7 @@ import (
"flag"
"fmt"
"io/ioutil"
+ "log"
"mojom/mojom_parser/formatter"
"os"
"path/filepath"
@@ -52,7 +53,7 @@ func fmtCmd(args []string) {
originalBytes, err := ioutil.ReadFile(inputFileName)
if err != nil {
- ErrorExit(err.Error())
+ log.Fatalln(err.Error())
}
original := string(originalBytes[:])
@@ -60,13 +61,13 @@ func fmtCmd(args []string) {
var formatted string
formatted, err = formatter.FormatMojom(inputFileName, original)
if err != nil {
- ErrorExit(err.Error())
+ log.Fatalln(err.Error())
}
if overwrite {
if formatted != original {
if err := ioutil.WriteFile(inputFileName, []byte(formatted), 0); err != nil {
- ErrorExit(err.Error())
+ log.Fatalln(err.Error())
}
}
} else {
« no previous file with comments | « mojom/mojom_parser/check_version.go ('k') | mojom/mojom_parser/mojom_main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698