flags: Cleanup the homepath() function.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2015-01-22 14:56:38 -08:00
parent 9dd96077c3
commit 45dbe6b73f
1 changed files with 3 additions and 2 deletions

View File

@ -8,10 +8,11 @@ import (
) )
func homepath(p string) string { func homepath(p string) string {
home := os.Getenv("HOME")
if runtime.GOOS == "windows" { 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 { func getDiscovery(c *cli.Context) string {