mirror of https://github.com/spf13/afero.git
Start MemMapFS with a root directory.
This commit is contained in:
parent
f85f3b3779
commit
75dc847d59
|
@ -44,6 +44,10 @@ func (m *MemMapFs) runlock() { m.getMutex().RUnlock() }
|
|||
func (m *MemMapFs) getData() map[string]File {
|
||||
if m.data == nil {
|
||||
m.data = make(map[string]File)
|
||||
|
||||
// Root should always exist, right?
|
||||
// TODO: what about windows?
|
||||
m.getData()["/"] = &InMemoryFile{name: "/", memDir: &MemDirMap{}, dir: true}
|
||||
}
|
||||
return m.data
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue