@ -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)