config: keep configDir empty when homedir errors

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2019-09-24 23:48:59 +00:00
parent 0397c2ca01
commit 47f059db7a
1 changed files with 2 additions and 3 deletions

View File

@ -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)
}
}