[opt] currentPath support windows and linux (#139)

Co-authored-by: hesu <hesu@eacomp.com>
This commit is contained in:
flytutu
2023-09-23 13:45:21 +08:00
committed by GitHub
co-authored by hesu
parent f445ecbaf8
commit a9f01d8a69
+1 -2
View File
@@ -18,7 +18,6 @@ import (
"io/fs" "io/fs"
"net/http" "net/http"
"os" "os"
"path"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strings" "strings"
@@ -491,7 +490,7 @@ func CurrentPath() string {
var absPath string var absPath string
_, filename, _, ok := runtime.Caller(1) _, filename, _, ok := runtime.Caller(1)
if ok { if ok {
absPath = path.Dir(filename) absPath = filepath.Dir(filename)
} }
return absPath return absPath