aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime-lldb_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-10-29 14:17:47 -0400
committerRuss Cox <rsc@golang.org>2020-12-09 19:12:23 +0000
commit4f1b0a44cb46f3df28f5ef82e5769ebeac1bc493 (patch)
treec186cc25257b05fcb21cd8c1f1ee5961ebef6eb3 /src/runtime/runtime-lldb_test.go
parent5627a4dc3013fed02c4b8097413643b682cac276 (diff)
downloadgo-4f1b0a44cb46f3df28f5ef82e5769ebeac1bc493.tar.xz
all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp
As part of #42026, these helpers from io/ioutil were moved to os. (ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.) Update the Go tree to use the preferred names. As usual, code compiled with the Go 1.4 bootstrap toolchain and code vendored from other sources is excluded. ReadDir changes are in a separate CL, because they are not a simple search and replace. For #42026. Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/266365 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/runtime-lldb_test.go')
-rw-r--r--src/runtime/runtime-lldb_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/runtime/runtime-lldb_test.go b/src/runtime/runtime-lldb_test.go
index 1e2e5d5be9..c923b872aa 100644
--- a/src/runtime/runtime-lldb_test.go
+++ b/src/runtime/runtime-lldb_test.go
@@ -6,7 +6,6 @@ package runtime_test
import (
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -143,20 +142,20 @@ func TestLldbPython(t *testing.T) {
checkLldbPython(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
defer os.RemoveAll(dir)
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(lldbHelloSource), 0644)
+ err = os.WriteFile(src, []byte(lldbHelloSource), 0644)
if err != nil {
t.Fatalf("failed to create src file: %v", err)
}
mod := filepath.Join(dir, "go.mod")
- err = ioutil.WriteFile(mod, []byte("module lldbtest"), 0644)
+ err = os.WriteFile(mod, []byte("module lldbtest"), 0644)
if err != nil {
t.Fatalf("failed to create mod file: %v", err)
}
@@ -172,7 +171,7 @@ func TestLldbPython(t *testing.T) {
}
src = filepath.Join(dir, "script.py")
- err = ioutil.WriteFile(src, []byte(lldbScriptSource), 0755)
+ err = os.WriteFile(src, []byte(lldbScriptSource), 0755)
if err != nil {
t.Fatalf("failed to create script: %v", err)
}