Merge pull request #329 from yearnfar/master

bugfix: RemoveAll
This commit is contained in:
Martin Bertschler 2022-03-11 11:19:41 +01:00 committed by GitHub
commit a2bf4c852d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -279,7 +279,7 @@ func (m *MemMapFs) RemoveAll(path string) error {
defer m.mu.RUnlock()
for p := range m.getData() {
if strings.HasPrefix(p, path) {
if p == path || strings.HasPrefix(p, path+FilePathSeparator) {
m.mu.RUnlock()
m.mu.Lock()
delete(m.getData(), p)