From 8b00c8f60815fbd5eb73b82923719ce63e7cbedd Mon Sep 17 00:00:00 2001 From: forget-the-bright Date: Wed, 29 Mar 2023 14:17:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=81=97=E7=95=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/cli.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 08e1c54..75ca17a 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -100,15 +100,14 @@ const ( // ghome 返回g根目录 func ghome() (dir string) { //fmt.Println(os.Getenv(homeEnv)) - path, _ := os.Getwd() - return path - /* if dir = os.Getenv(homeEnv); dir != "" { + /* path, _ := os.Getwd() + return path */ + if dir = os.Getenv(homeEnv); dir != "" { return dir } homeDir, _ := os.UserHomeDir() - return filepath.Join(homeDir, ".j") */ - /* path, _ := os.Getwd() - return path */ + return filepath.Join(homeDir, ".j") + } // inuse 返回当前的go版本号