aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-01-29 16:36:25 -0800
committerIan Lance Taylor <iant@golang.org>2019-01-30 01:39:37 +0000
commitea27cd35fa07b874b3dff5d2f83dd401a361865e (patch)
tree5aacd6758ece9f07de76f61f55c0a3eb14446978
parentda648eac67dded869cfb6af2c0661f21af064f02 (diff)
downloadgo-ea27cd35fa07b874b3dff5d2f83dd401a361865e.tar.gz
go-ea27cd35fa07b874b3dff5d2f83dd401a361865e.zip
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>
-rw-r--r--src/os/path.go8
-rw-r--r--src/os/removeall_at.go2
-rw-r--r--src/os/removeall_noat.go6
3 files changed, 10 insertions, 6 deletions
diff --git a/src/os/path.go b/src/os/path.go
index 30cc6c8b98..104b7ceaf7 100644
--- a/src/os/path.go
+++ b/src/os/path.go
@@ -58,6 +58,14 @@ func MkdirAll(path string, perm FileMode) error {
return nil
}
+// RemoveAll removes path and any children it contains.
+// It removes everything it can but returns the first error
+// it encounters. If the path does not exist, RemoveAll
+// returns nil (no error).
+func RemoveAll(path string) error {
+ return removeAll(path)
+}
+
// endsWithDot reports whether the final component of path is ".".
func endsWithDot(path string) bool {
if path == "." {
diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go
index faee1287f1..fe8b1faf2b 100644
--- a/src/os/removeall_at.go
+++ b/src/os/removeall_at.go
@@ -13,7 +13,7 @@ import (
"syscall"
)
-func RemoveAll(path string) error {
+func removeAll(path string) error {
if path == "" {
// fail silently to retain compatibility with previous behavior
// of RemoveAll. See issue 28830.
diff --git a/src/os/removeall_noat.go b/src/os/removeall_noat.go
index 80527e227c..5a7dc263f0 100644
--- a/src/os/removeall_noat.go
+++ b/src/os/removeall_noat.go
@@ -11,11 +11,7 @@ import (
"syscall"
)
-// RemoveAll removes path and any children it contains.
-// It removes everything it can but returns the first error
-// it encounters. If the path does not exist, RemoveAll
-// returns nil (no error).
-func RemoveAll(path string) error {
+func removeAll(path string) error {
if path == "" {
// fail silently to retain compatibility with previous behavior
// of RemoveAll. See issue 28830.