Skip to content

Commit

Permalink
return no error if file doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
typerat committed Feb 22, 2022
1 parent 450b30f commit e08384e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gcsfs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,14 @@ func (fs *Fs) RemoveAll(path string) error {
}

pathInfo, err := fs.Stat(path)
if errors.Is(err, ErrFileNotFound) {
// return early if file doesn't exist
return nil
}
if err != nil {
return err
}

if !pathInfo.IsDir() {
return fs.Remove(path)
}
Expand Down

0 comments on commit e08384e

Please sign in to comment.