diff --git a/pkg/util/path.go b/pkg/util/path.go index ff51d579..24516032 100644 --- a/pkg/util/path.go +++ b/pkg/util/path.go @@ -48,11 +48,11 @@ func FormSlash(old string) string { return path.Clean(strings.ReplaceAll(old, "\\", "/")) } -// RelativePath 获取相对可执行文件的路径 +// RelativePath 获取相对工作目录的路径 func RelativePath(name string) string { if filepath.IsAbs(name) { return name } - e, _ := os.Executable() - return filepath.Join(filepath.Dir(e), name) + e, _ := os.Getwd() + return filepath.Join(e, name) }