Skip to content

Commit

Permalink
refactor: refactor data reading to use io package consistently
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
appleboy committed Aug 24, 2024
1 parent 506e1f1 commit a6b2037
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gzip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"compress/gzip"
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"net/http/httputil"
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit a6b2037

Please sign in to comment.