Mem FS doesn't remove fs entries when location.DeleteFile is called
funkyshu opened this issue · comments
Describe the bug
Mem backend doesn't remove filesystem entries when deleted from location.DeleteFile()
but rather sets is value to nil. file.Delete()
appears to delete properly.
To Reproduce
Steps to reproduce the behavior:
- Call
NewFile
on mem fs andTouch
orWrite
/Close
to make them "exist". - range over
location.List()
files - calling
file.Exists()
on each, no error expected - calling
location.DeleteFile(file)
on each, no error expected - Now range over
location.List()
files (should return no files but it does) - calling
file.Exists()
results innil pointer dereference
panic
Expected behavior
Calling location.List()
after location.DeleteFile(file)
should return no results