From 47f059db7a9557696e817dc302a27c5e1f893555 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Tue, 24 Sep 2019 23:48:59 +0000 Subject: [PATCH] config: keep configDir empty when homedir errors Signed-off-by: Tibor Vass --- cli/config/config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/config/config.go b/cli/config/config.go index 312726f5a5..09810782c3 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -28,10 +28,9 @@ var ( func init() { if configDir == "" { homedir, err := os.UserHomeDir() - if err != nil { - panic(err) + if err == nil { + configDir = filepath.Join(homedir, configFileDir) } - configDir = filepath.Join(homedir, configFileDir) } }