mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
vfs: add Path method to Node and use it to stop reading nil DirEntry
All DirEntry calls now have been checked for nil or converted to use Path.
This commit is contained in:
@@ -61,6 +61,7 @@ type Node interface {
|
||||
VFS() *VFS
|
||||
Open(flags int) (Handle, error)
|
||||
Truncate(size int64) error
|
||||
Path() string
|
||||
}
|
||||
|
||||
// Check interfaces
|
||||
@@ -75,7 +76,7 @@ type Nodes []Node
|
||||
// Sort functions
|
||||
func (ns Nodes) Len() int { return len(ns) }
|
||||
func (ns Nodes) Swap(i, j int) { ns[i], ns[j] = ns[j], ns[i] }
|
||||
func (ns Nodes) Less(i, j int) bool { return ns[i].DirEntry().Remote() < ns[j].DirEntry().Remote() }
|
||||
func (ns Nodes) Less(i, j int) bool { return ns[i].Path() < ns[j].Path() }
|
||||
|
||||
// Noder represents something which can return a node
|
||||
type Noder interface {
|
||||
|
||||
Reference in New Issue
Block a user