Skip to content

Commit

Permalink
bugfix: RemoveAll
Browse files Browse the repository at this point in the history
when i RemoveAll lib directory, it also Removed libs directory
  • Loading branch information
yearnfar committed Nov 14, 2021
1 parent 949437f commit 061c13d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion memmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 061c13d

Please sign in to comment.