aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-05-11 21:59:37 +0100
committerPaulo Gomes <pjbgf@linux.com>2023-05-11 21:59:37 +0100
commit096b3cc16b547f3c0d6e4f92046945bcfac0fa14 (patch)
treedf3e5f5265aac52a6683be10d74561e26e70cb0c /utils
parent9dfaf6acd8e3aa1c85bcce7d45f8e8c6b908319c (diff)
downloadgo-git-096b3cc16b547f3c0d6e4f92046945bcfac0fa14.tar.gz
*: Remove use of deprecated io/util
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/ioutil/common_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/ioutil/common_test.go b/utils/ioutil/common_test.go
index 27bfa62..e3c9d69 100644
--- a/utils/ioutil/common_test.go
+++ b/utils/ioutil/common_test.go
@@ -3,7 +3,7 @@ package ioutil
import (
"bytes"
"context"
- "io/ioutil"
+ "io"
"strings"
"testing"
@@ -38,7 +38,7 @@ func (s *CommonSuite) TestNonEmptyReader_NonEmpty(c *C) {
c.Assert(err, IsNil)
c.Assert(r, NotNil)
- read, err := ioutil.ReadAll(r)
+ read, err := io.ReadAll(r)
c.Assert(err, IsNil)
c.Assert(string(read), Equals, "1")
}
@@ -48,7 +48,7 @@ func (s *CommonSuite) TestNewReadCloser(c *C) {
closer := &closer{}
r := NewReadCloser(buf, closer)
- read, err := ioutil.ReadAll(r)
+ read, err := io.ReadAll(r)
c.Assert(err, IsNil)
c.Assert(string(read), Equals, "1")
@@ -160,7 +160,7 @@ func ExampleCheckClose() {
// CheckClose is commonly used with named return values
f := func() (err error) {
// Get a io.ReadCloser
- r := ioutil.NopCloser(strings.NewReader("foo"))
+ r := io.NopCloser(strings.NewReader("foo"))
// defer CheckClose call with an io.Closer and pointer to error
defer CheckClose(r, &err)