🐛 fix windows check parent password

This commit is contained in:
微凉
2021-11-29 21:09:16 +08:00
parent ffdd88ec66
commit 71b1517de7
5 changed files with 13 additions and 9 deletions

View File

@ -94,4 +94,10 @@ func RemoveLastSlash(path string) string {
return strings.TrimSuffix(path, "/")
}
return path
}
func Dir(path string) string {
path = ParsePath(path)
idx := strings.LastIndex(path, "/")
return path[:idx]
}