Skip to content

Commit ea27cd3

Browse files
os: restore RemoveAll docs by making a single copy
Updates #29983 Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5 Reviewed-on: https://go-review.googlesource.com/c/160182 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
1 parent da648ea commit ea27cd3

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/os/path.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ func MkdirAll(path string, perm FileMode) error {
5858
return nil
5959
}
6060

61+
// RemoveAll removes path and any children it contains.
62+
// It removes everything it can but returns the first error
63+
// it encounters. If the path does not exist, RemoveAll
64+
// returns nil (no error).
65+
func RemoveAll(path string) error {
66+
return removeAll(path)
67+
}
68+
6169
// endsWithDot reports whether the final component of path is ".".
6270
func endsWithDot(path string) bool {
6371
if path == "." {

src/os/removeall_at.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"syscall"
1414
)
1515

16-
func RemoveAll(path string) error {
16+
func removeAll(path string) error {
1717
if path == "" {
1818
// fail silently to retain compatibility with previous behavior
1919
// of RemoveAll. See issue 28830.

src/os/removeall_noat.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import (
1111
"syscall"
1212
)
1313

14-
// RemoveAll removes path and any children it contains.
15-
// It removes everything it can but returns the first error
16-
// it encounters. If the path does not exist, RemoveAll
17-
// returns nil (no error).
18-
func RemoveAll(path string) error {
14+
func removeAll(path string) error {
1915
if path == "" {
2016
// fail silently to retain compatibility with previous behavior
2117
// of RemoveAll. See issue 28830.

0 commit comments

Comments
 (0)