From a6b20374a6768725d3c57e8e692231c9f2c3ada0 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 24 Aug 2024 08:10:50 +0800 Subject: [PATCH] refactor: refactor data reading to use io package consistently - Replace usage of ioutil with io for reading data - Update import statement to reflect the change from ioutil to io - Ensure consistency in reading data across multiple test functions Signed-off-by: Bo-Yi Wu --- gzip_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gzip_test.go b/gzip_test.go index f5e381b..91e840e 100644 --- a/gzip_test.go +++ b/gzip_test.go @@ -5,7 +5,7 @@ import ( "compress/gzip" "context" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "net/http/httputil" @@ -81,7 +81,7 @@ func TestGzip(t *testing.T) { assert.NoError(t, err) defer gr.Close() - body, _ := ioutil.ReadAll(gr) + body, _ := io.ReadAll(gr) assert.Equal(t, string(body), testResponse) } @@ -170,7 +170,7 @@ func TestGzipWithReverseProxy(t *testing.T) { assert.NoError(t, err) defer gr.Close() - body, _ := ioutil.ReadAll(gr) + body, _ := io.ReadAll(gr) assert.Equal(t, string(body), testReverseResponse) }