aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-10-16 00:49:02 -0400
committerRuss Cox <rsc@golang.org>2020-10-20 18:41:18 +0000
commit1b09d430678d4a6f73b2443463d11f75851aba8a (patch)
treefec040abfc6e1d897f8dcdbb856e77d5bccbb2ca /src/syscall
parentcb0a0f52e67f128c6ad69027c9a8c7a5caf58446 (diff)
downloadgo-1b09d430678d4a6f73b2443463d11f75851aba8a.tar.gz
go-1b09d430678d4a6f73b2443463d11f75851aba8a.zip
all: update references to symbols moved from io/ioutil to io
The old ioutil references are still valid, but update our code to reflect best practices and get used to the new locations. Code compiled with the bootstrap toolchain (cmd/asm, cmd/dist, cmd/compile, debug/elf) must remain Go 1.4-compatible and is excluded. Also excluded vendored code. For #41190. Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/263142 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/mkpost.go4
-rw-r--r--src/syscall/syscall_unix_test.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/syscall/mkpost.go b/src/syscall/mkpost.go
index d5f5c8d6d6..ef89128310 100644
--- a/src/syscall/mkpost.go
+++ b/src/syscall/mkpost.go
@@ -14,7 +14,7 @@ package main
import (
"fmt"
"go/format"
- "io/ioutil"
+ "io"
"log"
"os"
"regexp"
@@ -22,7 +22,7 @@ import (
)
func main() {
- b, err := ioutil.ReadAll(os.Stdin)
+ b, err := io.ReadAll(os.Stdin)
if err != nil {
log.Fatal(err)
}
diff --git a/src/syscall/syscall_unix_test.go b/src/syscall/syscall_unix_test.go
index d754c075f1..1c34ed2c27 100644
--- a/src/syscall/syscall_unix_test.go
+++ b/src/syscall/syscall_unix_test.go
@@ -225,7 +225,7 @@ func TestPassFD(t *testing.T) {
f := os.NewFile(uintptr(gotFds[0]), "fd-from-child")
defer f.Close()
- got, err := ioutil.ReadAll(f)
+ got, err := io.ReadAll(f)
want := "Hello from child process!\n"
if string(got) != want {
t.Errorf("child process ReadAll: %q, %v; want %q", got, err, want)