diff options
| author | KimMachineGun <geon0250@gmail.com> | 2021-04-03 08:10:47 +0000 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2021-04-05 17:51:15 +0000 |
| commit | a040ebeb980d1a712509fa3d8073cf6ae16cbe78 (patch) | |
| tree | 5dbb3b41a6506cb0251e49a2bf83cccf3aa571c4 /src | |
| parent | 9abedf482752cac0a29c56804f7d34698aa044f2 (diff) | |
| download | go-a040ebeb980d1a712509fa3d8073cf6ae16cbe78.tar.xz | |
all: update references to symbols moved from io/ioutil to io
Update references missed in CL 263142.
For #41190
Change-Id: I778760a6a69bd0440fec0848bdef539c9ccb4ee1
GitHub-Last-Rev: dda42b09fff36dc08ec1cdec50cc19e3da5058e5
GitHub-Pull-Request: golang/go#42874
Reviewed-on: https://go-review.googlesource.com/c/go/+/273946
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/go/build/build.go | 1 | ||||
| -rw-r--r-- | src/internal/execabs/execabs_test.go | 5 | ||||
| -rw-r--r-- | src/net/http/fs_test.go | 3 | ||||
| -rw-r--r-- | src/syscall/exec_windows_test.go | 3 | ||||
| -rw-r--r-- | src/testing/fstest/testfs.go | 3 |
5 files changed, 6 insertions, 9 deletions
diff --git a/src/go/build/build.go b/src/go/build/build.go index 0732f6aa19..501ce2e8dd 100644 --- a/src/go/build/build.go +++ b/src/go/build/build.go @@ -188,6 +188,7 @@ func (ctxt *Context) readDir(path string) ([]fs.FileInfo, error) { if f := ctxt.ReadDir; f != nil { return f(path) } + // TODO: use os.ReadDir return ioutil.ReadDir(path) } diff --git a/src/internal/execabs/execabs_test.go b/src/internal/execabs/execabs_test.go index b71458587c..7609b2106a 100644 --- a/src/internal/execabs/execabs_test.go +++ b/src/internal/execabs/execabs_test.go @@ -8,7 +8,6 @@ import ( "context" "fmt" "internal/testenv" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -42,7 +41,7 @@ func TestCommand(t *testing.T) { if runtime.GOOS == "windows" { executable += ".exe" } - if err := ioutil.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil { + if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil { t.Fatalf("ioutil.WriteFile failed: %s", err) } cwd, err := os.Getwd() @@ -77,7 +76,7 @@ func TestLookPath(t *testing.T) { if runtime.GOOS == "windows" { executable += ".exe" } - if err := ioutil.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil { + if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil { t.Fatalf("ioutil.WriteFile failed: %s", err) } cwd, err := os.Getwd() diff --git a/src/net/http/fs_test.go b/src/net/http/fs_test.go index 2499051625..0ebb511b5c 100644 --- a/src/net/http/fs_test.go +++ b/src/net/http/fs_test.go @@ -11,7 +11,6 @@ import ( "fmt" "io" "io/fs" - "io/ioutil" "mime" "mime/multipart" "net" @@ -593,7 +592,7 @@ func TestServeIndexHtml(t *testing.T) { if err != nil { t.Fatal(err) } - b, err := ioutil.ReadAll(res.Body) + b, err := io.ReadAll(res.Body) if err != nil { t.Fatal("reading Body:", err) } diff --git a/src/syscall/exec_windows_test.go b/src/syscall/exec_windows_test.go index aeafb564b3..8b8f330e99 100644 --- a/src/syscall/exec_windows_test.go +++ b/src/syscall/exec_windows_test.go @@ -6,7 +6,6 @@ package syscall_test import ( "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -106,7 +105,7 @@ func TestChangingProcessParent(t *testing.T) { if err != nil { t.Errorf("child failed: %v: %v", err, string(childOutput)) } - childOutput, err = ioutil.ReadFile(childDumpPath) + childOutput, err = os.ReadFile(childDumpPath) if err != nil { t.Fatalf("reading child output failed: %v", err) } diff --git a/src/testing/fstest/testfs.go b/src/testing/fstest/testfs.go index e0ad60a17b..80ca0e9a1d 100644 --- a/src/testing/fstest/testfs.go +++ b/src/testing/fstest/testfs.go @@ -10,7 +10,6 @@ import ( "fmt" "io" "io/fs" - "io/ioutil" "path" "reflect" "sort" @@ -514,7 +513,7 @@ func (t *fsTester) checkFile(file string) { return } - data, err := ioutil.ReadAll(f) + data, err := io.ReadAll(f) if err != nil { f.Close() t.errorf("%s: Open+ReadAll: %v", file, err) |
