mirror of
https://github.com/golang/go
synced 2024-11-21 15:14:43 -07:00
os: make RemoveAll() work on windows
R=golang-dev, rsc1 CC=golang-dev https://golang.org/cl/2212041
This commit is contained in:
parent
7534d40f64
commit
9997dae7a3
@ -84,7 +84,6 @@ func RemoveAll(path string) Error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer fd.Close()
|
||||
|
||||
// Remove contents & return first error.
|
||||
err = nil
|
||||
@ -105,6 +104,9 @@ func RemoveAll(path string) Error {
|
||||
}
|
||||
}
|
||||
|
||||
// Close directory, because windows won't remove opened directory.
|
||||
fd.Close()
|
||||
|
||||
// Remove directory.
|
||||
err1 := Remove(path)
|
||||
if err == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user