From 5e6714720497b45e5df9e52692040ab3f45182fa Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Mon, 27 Aug 2018 19:36:40 +0300 Subject: [PATCH] check HOME and USER variables on startup Related #108 --- os.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/os.go b/os.go index c2cf5a3..1e61466 100644 --- a/os.go +++ b/os.go @@ -56,6 +56,12 @@ func init() { u, err := user.Current() if err != nil { log.Printf("user: %s", err) + if os.Getenv("HOME") == "" { + log.Print("$HOME variable is empty or not set") + } + if os.Getenv("USER") == "" { + log.Print("$USER variable is empty or not set") + } } gUser = u