1
mirror of https://github.com/rclone/rclone synced 2025-03-22 04:24:24 +01:00

13 lines
253 B
Go
Raw Normal View History

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
}