aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/cmd/ast-printer/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/sqlvm/cmd/ast-printer/main.go')
-rw-r--r--core/vm/sqlvm/cmd/ast-printer/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/vm/sqlvm/cmd/ast-printer/main.go b/core/vm/sqlvm/cmd/ast-printer/main.go
index 6965a1d4e..86a742909 100644
--- a/core/vm/sqlvm/cmd/ast-printer/main.go
+++ b/core/vm/sqlvm/cmd/ast-printer/main.go
@@ -17,9 +17,9 @@ func main() {
n, err := parser.Parse([]byte(flag.Arg(0)))
fmt.Printf("detail: %t\n", detail)
- if err == nil {
- ast.PrintAST(os.Stdout, n, " ", detail)
- } else {
- fmt.Printf("err:\n%+v\n", err)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "err:\n%+v\n", err)
+ os.Exit(1)
}
+ ast.PrintAST(os.Stdout, n, " ", detail)
}