all: replace io/ioutil with io and os package

For golang/go#45557

Change-Id: I447530cc66896aef7a8d528ccb8d095b80e3cf47
GitHub-Last-Rev: 5f385ff46487ac318bd1147cdbbd26bb0ffd0426
GitHub-Pull-Request: golang/crypto#230
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/430797
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
cui fliter
2022-09-19 17:36:07 +00:00
committed by Gopher Robot
parent c86fa9a7ed
commit 35f4265a4b
30 changed files with 60 additions and 83 deletions
+3 -4
View File
@@ -6,7 +6,6 @@ package ssh
import (
"io"
"io/ioutil"
"sync"
"testing"
"time"
@@ -73,14 +72,14 @@ func TestMuxChannelExtendedThreadSafety(t *testing.T) {
rd.Add(2)
go func() {
c, err := ioutil.ReadAll(reader)
c, err := io.ReadAll(reader)
if string(c) != magic {
t.Fatalf("stdout read got %q, want %q (error %s)", c, magic, err)
}
rd.Done()
}()
go func() {
c, err := ioutil.ReadAll(reader.Stderr())
c, err := io.ReadAll(reader.Stderr())
if string(c) != magic {
t.Fatalf("stderr read got %q, want %q (error %s)", c, magic, err)
}
@@ -670,7 +669,7 @@ func TestZeroWindowAdjust(t *testing.T) {
}()
want := "helloworld"
c, _ := ioutil.ReadAll(b)
c, _ := io.ReadAll(b)
if string(c) != want {
t.Errorf("got %q want %q", c, want)
}