afero
afero copied to clipboard
MemMapFs paths are reported as being on the actual system OS
I just discovered afero and tried the in memory filesystem, upon playing with these two lines of code below I noticed that the reported path of the temporary files is on my local machine:
C:\Users\federico.d\AppData\Local\Temp\108673950
(property afero.File.fileData.name)
However, the file doesn't actually exist on the OS.
memFS := afero.NewMemMapFs()
temp1, _ := afero.TempFile(memFS, "", "")
This isn't at all an issue, I suppose, but it raised concerns on me when I was about to execute a RemoveAll on a path.
Is this the expected behaviour and if so why mimicking real OS paths?
No, it is not the expected behavior and is making it hard for me to do unit tests using the InMemory storage