diff --git a/settings/flimit.go b/settings/flimit.go index 4aa15d5..f1ccfbf 100644 --- a/settings/flimit.go +++ b/settings/flimit.go @@ -1,4 +1,3 @@ - // +build !windows package settings @@ -12,6 +11,6 @@ func (s *Settings) Flimit() { rLimit.Cur = s.Config.Flimit err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { - s.Fatal("Error Setting Rlimit", err) + s.Fatal(err, "Error setting rlimit") } } diff --git a/settings/utils.go b/settings/utils.go index a030559..e67c502 100644 --- a/settings/utils.go +++ b/settings/utils.go @@ -14,14 +14,14 @@ func (s Settings) Wdir() string { func (s Settings) Validate(err error) error { if err != nil { - s.Fatal("", err) + s.Fatal(err, "") } return nil } -func (s Settings) Fatal(msg string, err error) { - if msg != "" { - log.Fatal(s.Red.Regular(msg), err.Error()) +func (s Settings) Fatal(err error, msg ...interface{}) { + if len(msg) > 0 { + log.Fatalln(s.Red.Regular(msg...), err.Error()) } - log.Fatal(err.Error()) + log.Fatalln(err.Error()) }