From a9f01d8a6919e265106167113b30d4802ddfe8cb Mon Sep 17 00:00:00 2001 From: flytutu <55188970+flytutu-susu@users.noreply.github.com> Date: Sat, 23 Sep 2023 13:45:21 +0800 Subject: [PATCH] [opt] currentPath support windows and linux (#139) Co-authored-by: hesu --- fileutil/file.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fileutil/file.go b/fileutil/file.go index 3a043dc..afd5da3 100644 --- a/fileutil/file.go +++ b/fileutil/file.go @@ -18,7 +18,6 @@ import ( "io/fs" "net/http" "os" - "path" "path/filepath" "runtime" "strings" @@ -491,7 +490,7 @@ func CurrentPath() string { var absPath string _, filename, _, ok := runtime.Caller(1) if ok { - absPath = path.Dir(filename) + absPath = filepath.Dir(filename) } return absPath