From 8b0e65010d6d3c9c8011b2401e22aa3b11bda7af Mon Sep 17 00:00:00 2001 From: cui fliter Date: Wed, 14 Sep 2022 11:58:32 +0800 Subject: [PATCH] all: replace io/ioutil with io and os package Signed-off-by: cui fliter --- byteview_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/byteview_test.go b/byteview_test.go index a09757aa..b494d753 100644 --- a/byteview_test.go +++ b/byteview_test.go @@ -20,7 +20,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "testing" ) @@ -42,10 +41,10 @@ func TestByteView(t *testing.T) { if n := v.Copy(shortDest[:]); n != min(len(s), 1) { t.Errorf("%s: short Copy = %d; want %d", name, n, min(len(s), 1)) } - if got, err := ioutil.ReadAll(v.Reader()); err != nil || string(got) != s { + if got, err := io.ReadAll(v.Reader()); err != nil || string(got) != s { t.Errorf("%s: Reader = %q, %v; want %q", name, got, err, s) } - if got, err := ioutil.ReadAll(io.NewSectionReader(v, 0, int64(len(s)))); err != nil || string(got) != s { + if got, err := io.ReadAll(io.NewSectionReader(v, 0, int64(len(s)))); err != nil || string(got) != s { t.Errorf("%s: SectionReader of ReaderAt = %q, %v; want %q", name, got, err, s) } var dest bytes.Buffer