From 05310d8fa4ce7a810bd23ff190efa25e8b3abb6f Mon Sep 17 00:00:00 2001 From: alessio Date: Sun, 25 Dec 2016 16:32:17 +0100 Subject: [PATCH] fatal method fixed --- settings/utils.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/settings/utils.go b/settings/utils.go index 38804c9..117a34f 100644 --- a/settings/utils.go +++ b/settings/utils.go @@ -23,8 +23,9 @@ func (s Settings) Validate(err error) error { // Fatal prints a fatal error with its additional messages func (s Settings) Fatal(err error, msg ...interface{}) { - if len(msg) > 0 { + if len(msg) > 0 && err != nil { log.Fatalln(s.Red.Regular(msg...), err.Error()) + } else if err != nil { + log.Fatalln(err.Error()) } - log.Fatalln(err.Error()) }