1
mirror of https://github.com/rclone/rclone synced 2024-11-23 00:06:55 +01:00
rclone/vfs/vfscommon/path.go
2020-04-20 10:42:33 +01:00

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
}