-
Notifications
You must be signed in to change notification settings - Fork 117
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
Extend filesystem interface #264
Conversation
3b148db
to
305d4c1
Compare
Oh, just stumbled upon #233! What do you think about adding Rename() to the interface as well? |
I rather like this. Thank you for doing it.
Yup, although that didn't complete the interface, and you did here. So let's complete this one, and then that can just be the specific implementation.
Sure. There is a parallel in
For now, let's deprecate it. Mark it as deprecated in the comments and refer to The only other comment I had was about the returned error. I will comment inline. Once that is in, I will kick off CI and this can run and get merged in. Thanks @aol-nnov ! |
Also, what do you think about adding chown and chmod as well? It seems, the interface will be complete then. |
Good call. |
Ok, will mock something as soon as I get to my laptop. |
305d4c1
to
3389941
Compare
Added Rename, Chown, Chmod to the Filesystem interface, used newly introduced |
3389941
to
904aebc
Compare
This is great. Let's let CI go, and if green, we can merge it in. |
Bummer!... Linter does not like parameters in unimplemented functions, but I'd rather keep them for documentation reasons... Is there any annotation for such cases? |
Some of the lint errors are duplication, e.g.: func (fs *FileSystem) Link(oldpath string, newpath string) error { Should be: func (fs *FileSystem) Link(oldpath, newpath string) error { Some of the others are shadow imports, like: func (fs *FileSystem) Mknod(path string, mode uint32, dev int) error { Which shadows the For the last, unused parameter, just replace it with func (fs *FileSystem) Rename(_, newpath string) error { Or, if you want to keep it, you can put in a nolint for it. E,g,: // Rename rename a file from oldpath to newpath
//
//nolint:unused-parameter // keep it around to make it easier in the future
func (fs *FileSystem) Rename(oldpath, newpath string) error { |
Thank you for the hints! Will fix this up shortly! |
For all the As for func (fs *FileSystem) Remove(_ /*pathname*/ string) error {
return filesystem.ErrNotImplemented
} The coder to implement this will then remove the placeholder and uncomment the actual parameter name. |
904aebc
to
896b1a5
Compare
896b1a5
to
c20b1cf
Compare
My mistake, it should be CI looks clean. Let's replace that, and then we can merge it in. |
Interface is extended as a part of ext4 improvements effort diskfs#9 (comment) New methods introduced: * Mknod * Link * Symlink * Chmod * Chown * Rename * Remove filesystem.ErrNotSupported is returned if FS does not support a method. Methods lacking implementation return filesystem.ErrNotImplemented.
c20b1cf
to
ffe4083
Compare
Okay, done. |
Interface is extended as a part of ext4 improvements effort
#9 (comment)
Also, Remove method is introduced for all supported filesystems.
@deitch should we keep
ext4.Rm()
or we can drop it alltogether infavour of newly introducedfilesystem.Remove()
?