Skip to content

Commit

Permalink
lint: fix deprecated ioutils in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene committed Feb 22, 2024
1 parent 0ee72d2 commit 5da7f97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions group_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package routegroup_test

import (
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestHTTPServerWithBasePathAndMiddleware(t *testing.T) {
})
})

group.Handle("/test", func(w http.ResponseWriter, r *http.Request) {
group.Handle("/test", func(w http.ResponseWriter, _ *http.Request) {
_, _ = w.Write([]byte("test handler"))
})

Expand All @@ -161,7 +161,7 @@ func TestHTTPServerWithBasePathAndMiddleware(t *testing.T) {
assert.NoError(t, err)
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
assert.NoError(t, err)

assert.Equal(t, "test handler", string(body))
Expand All @@ -174,7 +174,7 @@ func TestHTTPServerMethodAndPathHandling(t *testing.T) {

group.Use(testMiddleware)

group.Handle("GET /test", func(w http.ResponseWriter, r *http.Request) {
group.Handle("GET /test", func(w http.ResponseWriter, _ *http.Request) {
_, _ = w.Write([]byte("GET method handler"))
})

Expand All @@ -185,7 +185,7 @@ func TestHTTPServerMethodAndPathHandling(t *testing.T) {
assert.NoError(t, err)
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
assert.NoError(t, err)

assert.Equal(t, "GET method handler", string(body))
Expand Down

0 comments on commit 5da7f97

Please sign in to comment.