aboutsummaryrefslogtreecommitdiff
path: root/src/os/removeall_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-10-29 13:51:20 -0400
committerRuss Cox <rsc@golang.org>2020-12-02 17:00:06 +0000
commit3d913a926675d8d6fcdc3cfaefd3136dfeba06e1 (patch)
treef67a6801ab129669a604f897423b5b12e6874328 /src/os/removeall_test.go
parent5984ea71977d8436436a096902a32974b958c0bb (diff)
downloadgo-3d913a926675d8d6fcdc3cfaefd3136dfeba06e1.tar.xz
os: add ReadFile, WriteFile, CreateTemp (was TempFile), MkdirTemp (was TempDir) from io/ioutil
io/ioutil was a poorly defined collection of helpers. Proposal #40025 moved out the generic I/O helpers to io. This CL for proposal #42026 moves the OS-specific helpers to os, making the entire io/ioutil package deprecated. For #42026. Change-Id: I018bcb2115ef2ff1bc7ca36a9247eda429af21ad Reviewed-on: https://go-review.googlesource.com/c/go/+/266364 Trust: Russ Cox <rsc@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Diffstat (limited to 'src/os/removeall_test.go')
-rw-r--r--src/os/removeall_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go
index bc9c468ce3..90efa313ea 100644
--- a/src/os/removeall_test.go
+++ b/src/os/removeall_test.go
@@ -355,11 +355,12 @@ func TestRemoveAllButReadOnlyAndPathError(t *testing.T) {
// The error should be of type *PathError.
// see issue 30491 for details.
if pathErr, ok := err.(*PathError); ok {
- if g, w := pathErr.Path, filepath.Join(tempDir, "b", "y"); g != w {
- t.Errorf("got %q, expected pathErr.path %q", g, w)
+ want := filepath.Join(tempDir, "b", "y")
+ if pathErr.Path != want {
+ t.Errorf("RemoveAll(%q): err.Path=%q, want %q", tempDir, pathErr.Path, want)
}
} else {
- t.Errorf("got %T, expected *fs.PathError", err)
+ t.Errorf("RemoveAll(%q): error has type %T, want *fs.PathError", tempDir, err)
}
for _, dir := range dirs {