9
9
"encoding/json"
10
10
"errors"
11
11
"fmt"
12
- "io/ioutil "
12
+ "io"
13
13
"log"
14
14
"math/rand"
15
15
"mime/multipart"
@@ -40,7 +40,7 @@ var app = New(
40
40
WithDefaultParams (testDefaultParams ),
41
41
WithMaxBodySize (maxBodySize ),
42
42
WithMaxDuration (maxDuration ),
43
- WithObserver (StdLogObserver (log .New (ioutil .Discard , "" , 0 ))),
43
+ WithObserver (StdLogObserver (log .New (io .Discard , "" , 0 ))),
44
44
)
45
45
46
46
var handler = app .Handler ()
@@ -1489,7 +1489,7 @@ func TestGzip(t *testing.T) {
1489
1489
t .Fatalf ("error creating gzip reader: %s" , err )
1490
1490
}
1491
1491
1492
- unzippedBody , err := ioutil .ReadAll (gzipReader )
1492
+ unzippedBody , err := io .ReadAll (gzipReader )
1493
1493
if err != nil {
1494
1494
t .Fatalf ("error reading gzipped body: %s" , err )
1495
1495
}
@@ -1533,7 +1533,7 @@ func TestDeflate(t *testing.T) {
1533
1533
if err != nil {
1534
1534
t .Fatal (err )
1535
1535
}
1536
- body , err := ioutil .ReadAll (reader )
1536
+ body , err := io .ReadAll (reader )
1537
1537
if err != nil {
1538
1538
t .Fatal (err )
1539
1539
}
@@ -1805,7 +1805,7 @@ func TestDrip(t *testing.T) {
1805
1805
}
1806
1806
defer resp .Body .Close ()
1807
1807
1808
- body , _ := ioutil .ReadAll (resp .Body )
1808
+ body , _ := io .ReadAll (resp .Body )
1809
1809
if err != nil {
1810
1810
t .Fatalf ("error reading response body: %s" , err )
1811
1811
}
@@ -1829,7 +1829,7 @@ func TestDrip(t *testing.T) {
1829
1829
}
1830
1830
1831
1831
// in this case, the timeout happens while trying to read the body
1832
- body , err := ioutil .ReadAll (resp .Body )
1832
+ body , err := io .ReadAll (resp .Body )
1833
1833
if err == nil {
1834
1834
t .Fatal ("expected timeout reading body" )
1835
1835
}
@@ -1892,7 +1892,7 @@ func TestDrip(t *testing.T) {
1892
1892
}
1893
1893
defer resp .Body .Close ()
1894
1894
1895
- body , err := ioutil .ReadAll (resp .Body )
1895
+ body , err := io .ReadAll (resp .Body )
1896
1896
if err != nil {
1897
1897
t .Fatalf ("error reading response body: %s" , err )
1898
1898
}
0 commit comments