From 45dbe6b73fa532a57e899083ce5228928e6a103c Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 22 Jan 2015 14:56:38 -0800 Subject: [PATCH] flags: Cleanup the homepath() function. Signed-off-by: Andrea Luzzardi --- flags.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flags.go b/flags.go index e5891b5ce6..514a3fd00a 100644 --- a/flags.go +++ b/flags.go @@ -8,10 +8,11 @@ import ( ) func homepath(p string) string { + home := os.Getenv("HOME") if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("USERPROFILE"), p) + home = os.Getenv("USERPROFILE") } - return filepath.Join(os.Getenv("HOME"), p) + return filepath.Join(home, p) } func getDiscovery(c *cli.Context) string {