summaryrefslogtreecommitdiff
path: root/cmd/util/exit.go
diff options
context:
space:
mode:
authorDmitry Lihachev <[email protected]>2019-05-24 15:43:43 +0700
committerDmitry Lihachev <[email protected]>2019-05-24 15:59:44 +0700
commit2b874e9ed85bd85f42e60c29b0363f01a56e46e7 (patch)
tree31bacf035ad3f5494d4e76b64688a57726b029b4 /cmd/util/exit.go
parent1b1a43ce1140a7c4c4128d76ed1243d0d20b7c70 (diff)
Print errors to stderr
Diffstat (limited to 'cmd/util/exit.go')
-rw-r--r--cmd/util/exit.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/util/exit.go b/cmd/util/exit.go
new file mode 100644
index 00000000..96fcbf3c
--- /dev/null
+++ b/cmd/util/exit.go
@@ -0,0 +1,11 @@
+package util
+
+import (
+ "os"
+)
+
+// ExitWithError prints error and exits with error code`.
+func ExitWithError(err error) {
+ Panicf("<red+hb>Error:</reset> <red>%s</reset>\n", err)
+ os.Exit(1)
+}