]> Cypherpunks repositories - gostls13.git/commitdiff
os: add a comment inside RemoveAll
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Sep 2014 21:55:19 +0000 (14:55 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Sep 2014 21:55:19 +0000 (14:55 -0700)
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/149950043

src/os/path.go

index b1a90b3e5258b78bbac86342ca8615ac42374afb..24a3415b4660b7e0ab0f1e54c83fcb0d19a73a6e 100644 (file)
@@ -87,6 +87,8 @@ func RemoveAll(path string) error {
        fd, err := Open(path)
        if err != nil {
                if IsNotExist(err) {
+                       // Race. It was deleted between the Lstat and Open.
+                       // Return nil per RemoveAll's docs.
                        return nil
                }
                return err