@@ -125,7 +125,7 @@ See [examples](https://github.com/h2non/gock/tree/master/_examples) directory fo
125125package test
126126
127127import (
128- " io/ioutil "
128+ " io"
129129 " net/http"
130130 " testing"
131131
@@ -145,7 +145,7 @@ func TestSimple(t *testing.T) {
145145 st.Expect (t, err, nil )
146146 st.Expect (t, res.StatusCode , 200 )
147147
148- body , _ := ioutil .ReadAll (res.Body )
148+ body , _ := io .ReadAll (res.Body )
149149 st.Expect (t, string (body)[:13 ], ` {"foo":"bar"}` )
150150
151151 // Verify that we don't have pending mocks
@@ -159,7 +159,7 @@ func TestSimple(t *testing.T) {
159159package test
160160
161161import (
162- " io/ioutil "
162+ " io"
163163 " net/http"
164164 " testing"
165165
@@ -185,7 +185,7 @@ func TestMatchHeaders(t *testing.T) {
185185 res , err := (&http.Client {}).Do (req)
186186 st.Expect (t, err, nil )
187187 st.Expect (t, res.StatusCode , 200 )
188- body , _ := ioutil .ReadAll (res.Body )
188+ body , _ := io .ReadAll (res.Body )
189189 st.Expect (t, string (body), " foo foo" )
190190
191191 // Verify that we don't have pending mocks
@@ -199,7 +199,7 @@ func TestMatchHeaders(t *testing.T) {
199199package test
200200
201201import (
202- " io/ioutil "
202+ " io"
203203 " net/http"
204204 " testing"
205205
@@ -221,7 +221,7 @@ func TestMatchParams(t *testing.T) {
221221 res , err := (&http.Client {}).Do (req)
222222 st.Expect (t, err, nil )
223223 st.Expect (t, res.StatusCode , 200 )
224- body , _ := ioutil .ReadAll (res.Body )
224+ body , _ := io .ReadAll (res.Body )
225225 st.Expect (t, string (body), " foo foo" )
226226
227227 // Verify that we don't have pending mocks
@@ -236,7 +236,7 @@ package test
236236
237237import (
238238 " bytes"
239- " io/ioutil "
239+ " io"
240240 " net/http"
241241 " testing"
242242
@@ -259,7 +259,7 @@ func TestMockSimple(t *testing.T) {
259259 st.Expect (t, err, nil )
260260 st.Expect (t, res.StatusCode , 201 )
261261
262- resBody , _ := ioutil .ReadAll (res.Body )
262+ resBody , _ := io .ReadAll (res.Body )
263263 st.Expect (t, string (resBody)[:13 ], ` {"bar":"foo"}` )
264264
265265 // Verify that we don't have pending mocks
@@ -273,7 +273,7 @@ func TestMockSimple(t *testing.T) {
273273package test
274274
275275import (
276- " io/ioutil "
276+ " io"
277277 " net/http"
278278 " testing"
279279
@@ -295,7 +295,7 @@ func TestClient(t *testing.T) {
295295 res , err := client.Do (req)
296296 st.Expect (t, err, nil )
297297 st.Expect (t, res.StatusCode , 200 )
298- body , _ := ioutil .ReadAll (res.Body )
298+ body , _ := io .ReadAll (res.Body )
299299 st.Expect (t, string (body), " foo foo" )
300300
301301 // Verify that we don't have pending mocks
@@ -310,7 +310,7 @@ package main
310310
311311import (
312312 " fmt"
313- " io/ioutil "
313+ " io"
314314 " net/http"
315315
316316 " github.com/h2non/gock"
@@ -336,7 +336,7 @@ func main() {
336336 // The server header comes from mock as well
337337 fmt.Printf (" Server header: %s \n " , res.Header .Get (" Server" ))
338338 // Response body is the original
339- body , _ := ioutil .ReadAll (res.Body )
339+ body , _ := io .ReadAll (res.Body )
340340 fmt.Printf (" Body: %s " , string (body))
341341}
342342```
0 commit comments