From 0b60fef24620e813eb387f37fc8dfb7344157985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20K=C3=B6ser?= Date: Mon, 1 Feb 2021 10:48:34 +0100 Subject: [PATCH] refactor: write errors into stderr and add exit code Instead of writing errors into stdout and alway returning exit code 0, we now write into stderr and return exit code 1 in case that an error occured. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4c442fb3..a3a9f4e3 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ package main //go:generate git tag -af v$VERSION -m "v$VERSION" import ( - "fmt" + "log" "github.com/schollz/croc/v8/src/cli" ) @@ -28,6 +28,6 @@ func main() { // } // }() if err := cli.Run(); err != nil { - fmt.Println(err) + log.Fatalln(err) } }