mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 17:57:44 +08:00
13 lines
253 B
Go
13 lines
253 B
Go
package vfscommon
|
|
|
|
import "path/filepath"
|
|
|
|
// FindParent returns the parent directory of name, or "" for the root
|
|
func FindParent(name string) string {
|
|
parent := filepath.Dir(name)
|
|
if parent == "." || parent == "/" {
|
|
parent = ""
|
|
}
|
|
return parent
|
|
}
|