From b2ddac9abc04211df02cadb7df455a5c73b1066a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=B8=85=E4=BD=A0=E6=8A=A5=E8=AD=A6?= Date: Fri, 29 Oct 2021 11:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E7=9B=B8=E5=AF=B9=E5=B7=A5=E4=BD=9C=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=80=8C=E4=B8=8D=E6=98=AF=E5=8F=AF=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/util/path.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/path.go b/pkg/util/path.go index ff51d57..2451603 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) }