77 "bytes"
88 "context"
99 "fmt"
10- "io/ioutil "
10+ "io"
1111 "net/http"
1212 "regexp"
1313 "testing"
@@ -240,20 +240,20 @@ func (g *genericHandler) handle(t *testing.T, req *http.Request) (*http.Response
240240
241241 if req .URL .Path == singlePath && req .Method == http .MethodGet {
242242 if r .exists {
243- bodyRC := ioutil .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
243+ bodyRC := io .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
244244 return & http.Response {StatusCode : http .StatusOK , Header : cmdtesting .DefaultHeader (), Body : bodyRC }, true , nil
245245 }
246246 return & http.Response {StatusCode : http .StatusNotFound , Header : cmdtesting .DefaultHeader (), Body : cmdtesting .StringBody ("" )}, true , nil
247247 }
248248
249249 if req .URL .Path == singlePath && req .Method == http .MethodPatch {
250- bodyRC := ioutil .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
250+ bodyRC := io .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
251251 return & http.Response {StatusCode : http .StatusOK , Header : cmdtesting .DefaultHeader (), Body : bodyRC }, true , nil
252252 }
253253
254254 if req .URL .Path == singlePath && req .Method == http .MethodDelete {
255255 if r .exists {
256- bodyRC := ioutil .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
256+ bodyRC := io .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
257257 return & http.Response {StatusCode : http .StatusOK , Header : cmdtesting .DefaultHeader (), Body : bodyRC }, true , nil
258258 }
259259
@@ -271,12 +271,12 @@ func (g *genericHandler) handle(t *testing.T, req *http.Request) (*http.Response
271271 Kind : r .resource .GetKind (),
272272 },
273273 }
274- bodyRC := ioutil .NopCloser (bytes .NewReader (toJSONBytes (t , result )))
274+ bodyRC := io .NopCloser (bytes .NewReader (toJSONBytes (t , result )))
275275 return & http.Response {StatusCode : status , Header : cmdtesting .DefaultHeader (), Body : bodyRC }, true , nil
276276 }
277277
278278 if req .URL .Path == allPath && req .Method == http .MethodPost {
279- bodyRC := ioutil .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
279+ bodyRC := io .NopCloser (bytes .NewReader (toJSONBytes (t , r .resource )))
280280 return & http.Response {StatusCode : http .StatusCreated , Header : cmdtesting .DefaultHeader (), Body : bodyRC }, true , nil
281281 }
282282 }
@@ -341,7 +341,7 @@ func (n *nsHandler) handle(t *testing.T, req *http.Request) (*http.Response, boo
341341 Name : nsName ,
342342 },
343343 }
344- bodyRC := ioutil .NopCloser (bytes .NewReader (toJSONBytes (t , & ns )))
344+ bodyRC := io .NopCloser (bytes .NewReader (toJSONBytes (t , & ns )))
345345 return & http.Response {StatusCode : http .StatusOK , Header : cmdtesting .DefaultHeader (), Body : bodyRC }, true , nil
346346 }
347347 return nil , false , nil
0 commit comments