1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-12 16:52:29 +08:00

[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
parent f445ecbaf8
commit a9f01d8a69

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