-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileSystem interface: provide context, make FileInfo an interface #40
Comments
Yeah, context support is probably desirable.
Using pointers in slices is worse in this case, because each |
For example, for Google Drive it's convenient to keep additional information, such as an ID. Using an interface means I can reuse the same internal structure, as opposed to making a copy to be compatible with I agree on the GC overhead for a slice of points, but this may be premature optimization. Specifically, I'm worried that many file system implementations would keep a cache of FileInfo objects somewhere in a different structure (e.g. a tree) and would then need to construct a slice when |
The |
References: emersion#40
This doesn't really help, a slice of |
Just a suggestion: I was looking to potentially use this project instead of
golang.org/x/net/webdav
and noticed theFileSystem
interface is slightly different:go-webdav
doesn't pass aContext
to its calls.FileInfo
is a struct and not an interface.Readdir
returns a[]FileInfo
(slice of values) butStat
returns a*FileInfo
(pointer).I was wondering if you'd consider changing this in the future? Specifically, the first two are useful for when a file system is actually remote like e.g. Dropbox or Google Drive. And using pointers in the slice is just good for consistency (and also, deep copying a slice of values has a larger overhead).
The text was updated successfully, but these errors were encountered: