summaryrefslogtreecommitdiff
path: root/cmd/util/cprint.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/cprint.go
parent1b1a43ce1140a7c4c4128d76ed1243d0d20b7c70 (diff)
Print errors to stderr
Diffstat (limited to 'cmd/util/cprint.go')
-rw-r--r--cmd/util/cprint.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/util/cprint.go b/cmd/util/cprint.go
index c549317d..1d4d8cd3 100644
--- a/cmd/util/cprint.go
+++ b/cmd/util/cprint.go
@@ -5,6 +5,7 @@ import (
"github.com/mgutz/ansi"
"regexp"
"strings"
+ "os"
)
var (
@@ -35,3 +36,8 @@ func Sprintf(format string, args ...interface{}) string {
return fmt.Sprintf(format, args...)
}
+
+// Panicf prints `<white+hb>color formatted message to STDERR</reset>`.
+func Panicf(format string, args ...interface{}) {
+ fmt.Fprint(os.Stderr, Sprintf(format, args...))
+}