From 4f1b0a44cb46f3df28f5ef82e5769ebeac1bc493 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 29 Oct 2020 14:17:47 -0400 Subject: 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 Run-TryBot: Russ Cox TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- src/go/doc/doc_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/go/doc/doc_test.go') diff --git a/src/go/doc/doc_test.go b/src/go/doc/doc_test.go index ab98bed62b..cbdca62aa1 100644 --- a/src/go/doc/doc_test.go +++ b/src/go/doc/doc_test.go @@ -13,7 +13,7 @@ import ( "go/printer" "go/token" "io/fs" - "io/ioutil" + "os" "path/filepath" "regexp" "strings" @@ -127,7 +127,7 @@ func test(t *testing.T, mode Mode) { // update golden file if necessary golden := filepath.Join(dataDir, fmt.Sprintf("%s.%d.golden", pkg.Name, mode)) if *update { - err := ioutil.WriteFile(golden, got, 0644) + err := os.WriteFile(golden, got, 0644) if err != nil { t.Error(err) } @@ -135,7 +135,7 @@ func test(t *testing.T, mode Mode) { } // get golden file - want, err := ioutil.ReadFile(golden) + want, err := os.ReadFile(golden) if err != nil { t.Error(err) continue -- cgit v1.2.1