]> Cypherpunks repositories - gostls13.git/commitdiff
os: fix another case where RemoveAll should return nil
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Sep 2014 21:26:20 +0000 (14:26 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Sep 2014 21:26:20 +0000 (14:26 -0700)
This hopefully fixes issue 8793.

Fixes #8793

LGTM=iant
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/150860046

src/os/path.go

index 6cc69403b612372f140af2ea15270c9de1e3faac..b1a90b3e5258b78bbac86342ca8615ac42374afb 100644 (file)
@@ -86,6 +86,9 @@ func RemoveAll(path string) error {
        // Directory.
        fd, err := Open(path)
        if err != nil {
+               if IsNotExist(err) {
+                       return nil
+               }
                return err
        }