@@ -3,7 +3,6 @@ package ghttp_test
3
3
import (
4
4
"bytes"
5
5
"io"
6
- "io/ioutil"
7
6
"net/http"
8
7
"net/url"
9
8
"regexp"
@@ -60,7 +59,7 @@ var _ = Describe("TestServer", func() {
60
59
Expect (err ).ShouldNot (HaveOccurred ())
61
60
Expect (resp .StatusCode ).Should (Equal (200 ))
62
61
63
- body , err := ioutil .ReadAll (resp .Body )
62
+ body , err := io .ReadAll (resp .Body )
64
63
resp .Body .Close ()
65
64
Expect (err ).ShouldNot (HaveOccurred ())
66
65
@@ -70,7 +69,7 @@ var _ = Describe("TestServer", func() {
70
69
Expect (err ).ShouldNot (HaveOccurred ())
71
70
Expect (resp .StatusCode ).Should (Equal (200 ))
72
71
73
- body2 , err := ioutil .ReadAll (resp .Body )
72
+ body2 , err := io .ReadAll (resp .Body )
74
73
resp .Body .Close ()
75
74
Expect (err ).ShouldNot (HaveOccurred ())
76
75
@@ -102,7 +101,7 @@ var _ = Describe("TestServer", func() {
102
101
Expect (err ).ShouldNot (HaveOccurred ())
103
102
Expect (resp .StatusCode ).Should (Equal (http .StatusForbidden ))
104
103
105
- data , err := ioutil .ReadAll (resp .Body )
104
+ data , err := io .ReadAll (resp .Body )
106
105
Expect (err ).ShouldNot (HaveOccurred ())
107
106
Expect (data ).Should (BeEmpty ())
108
107
})
@@ -792,7 +791,7 @@ var _ = Describe("TestServer", func() {
792
791
793
792
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
794
793
795
- body , err := ioutil .ReadAll (resp .Body )
794
+ body , err := io .ReadAll (resp .Body )
796
795
Expect (err ).ShouldNot (HaveOccurred ())
797
796
Expect (body ).Should (Equal ([]byte ("sweet" )))
798
797
@@ -801,7 +800,7 @@ var _ = Describe("TestServer", func() {
801
800
802
801
Expect (resp .StatusCode ).Should (Equal (http .StatusOK ))
803
802
804
- body , err = ioutil .ReadAll (resp .Body )
803
+ body , err = io .ReadAll (resp .Body )
805
804
Expect (err ).ShouldNot (HaveOccurred ())
806
805
Expect (body ).Should (Equal ([]byte ("sour" )))
807
806
})
@@ -820,7 +819,7 @@ var _ = Describe("TestServer", func() {
820
819
Expect (err ).ShouldNot (HaveOccurred ())
821
820
822
821
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
823
- Expect (ioutil .ReadAll (resp .Body )).Should (Equal ([]byte ("sweet" )))
822
+ Expect (io .ReadAll (resp .Body )).Should (Equal ([]byte ("sweet" )))
824
823
Expect (resp .Header .Get ("X-Custom-Header" )).Should (Equal ("my header" ))
825
824
})
826
825
})
@@ -854,7 +853,7 @@ var _ = Describe("TestServer", func() {
854
853
855
854
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
856
855
857
- body , err := ioutil .ReadAll (resp .Body )
856
+ body , err := io .ReadAll (resp .Body )
858
857
Expect (err ).ShouldNot (HaveOccurred ())
859
858
Expect (body ).Should (Equal ([]byte ("tasty" )))
860
859
@@ -863,7 +862,7 @@ var _ = Describe("TestServer", func() {
863
862
864
863
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
865
864
866
- body , err = ioutil .ReadAll (resp .Body )
865
+ body , err = io .ReadAll (resp .Body )
867
866
Expect (err ).ShouldNot (HaveOccurred ())
868
867
Expect (body ).Should (Equal ([]byte ("treat" )))
869
868
})
@@ -881,7 +880,7 @@ var _ = Describe("TestServer", func() {
881
880
882
881
Expect (err ).ShouldNot (HaveOccurred ())
883
882
Expect (resp .StatusCode ).Should (Equal (http .StatusOK ))
884
- body , err := ioutil .ReadAll (resp .Body )
883
+ body , err := io .ReadAll (resp .Body )
885
884
Expect (err ).ShouldNot (HaveOccurred ())
886
885
Expect (body ).Should (BeEmpty ())
887
886
@@ -905,7 +904,7 @@ var _ = Describe("TestServer", func() {
905
904
906
905
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
907
906
908
- body , err := ioutil .ReadAll (resp .Body )
907
+ body , err := io .ReadAll (resp .Body )
909
908
Expect (err ).ShouldNot (HaveOccurred ())
910
909
Expect (body ).Should (MatchJSON ("[1,2,3]" ))
911
910
})
@@ -990,7 +989,7 @@ var _ = Describe("TestServer", func() {
990
989
991
990
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
992
991
993
- body , err := ioutil .ReadAll (resp .Body )
992
+ body , err := io .ReadAll (resp .Body )
994
993
Expect (err ).ShouldNot (HaveOccurred ())
995
994
Expect (body ).Should (MatchJSON (`{"Key": "Jim", "Value": "Codes"}` ))
996
995
})
@@ -1071,7 +1070,7 @@ var _ = Describe("TestServer", func() {
1071
1070
Expect (resp .StatusCode ).Should (Equal (http .StatusCreated ))
1072
1071
1073
1072
var received protobuf.SimpleMessage
1074
- body , err := ioutil .ReadAll (resp .Body )
1073
+ body , err := io .ReadAll (resp .Body )
1075
1074
Expect (err ).ShouldNot (HaveOccurred ())
1076
1075
err = proto .Unmarshal (body , & received )
1077
1076
Expect (err ).ShouldNot (HaveOccurred ())
0 commit comments