Skip to content

Commit

Permalink
fix:根目录问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky-lee committed Oct 22, 2020
1 parent 2518dd2 commit b5365fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gPath/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ func Current() string {
if err != nil {
log.Fatal(err)
}
return strings.Replace(dir, "\\", "/", -1) //将\替换成/

dirStr := strings.Replace(dir, "\\", "/", -1) //将\替换成/

if dirStr == "/" {
return ""
}
return dirStr
}

func CurrentFile(s string) string {
Expand Down

0 comments on commit b5365fb

Please sign in to comment.