forked from mirror/afero
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 {
|
func (m *MemMapFs) getData() map[string]File {
|
||||||
if m.data == nil {
|
if m.data == nil {
|
||||||
m.data = make(map[string]File)
|
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
|
return m.data
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue