From d8c8935d0c385c42828b38ee20a1efa95e10fbcb Mon Sep 17 00:00:00 2001 From: ehlxr Date: Fri, 13 Apr 2018 22:42:33 +0800 Subject: [PATCH] fix judge path func --- utils/httpcmder/main.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/utils/httpcmder/main.go b/utils/httpcmder/main.go index 1d9ea4b..6fec96e 100644 --- a/utils/httpcmder/main.go +++ b/utils/httpcmder/main.go @@ -95,12 +95,7 @@ func loadData(p string) []string { } func isPath(path string) (bool, string) { - p, err := filepath.Abs("") - if err != nil { - log.Fatal(err) - } - - absPath := filepath.Join(p, strings.Replace(path, p, "", 1)) + absPath, err := filepath.Abs(path) _, err = os.Stat(absPath) if err == nil { return true, absPath