Skip to content

Commit fc701ca

Browse files
author
Romain Dartigues
committed
"io/ioutils" has been deprecated since Go 1.19
1 parent 94f3992 commit fc701ca

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

retrywrapper.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
77
"code.cloudfoundry.org/cli/api/router"
88
"io"
9-
"io/ioutil"
109
"net/http"
1110
"reflect"
1211
)
@@ -46,7 +45,7 @@ func (retry *RetryRequest) Make(request *cloudcontroller.Request, passedResponse
4645

4746
// detect if body is ioutil.NopCloser(&bytes.Buffer)
4847
// if so we reset the content the buffer to be able to redo request with same body
49-
if reflect.TypeOf(request.Body) == reflect.TypeOf(ioutil.NopCloser) {
48+
if reflect.TypeOf(request.Body) == reflect.TypeOf(io.NopCloser) {
5049
reader := reflect.ValueOf(request.Body).FieldByName("Reader")
5150
if buf, ok := reader.Interface().(*bytes.Buffer); ok {
5251
data := buf.Bytes()
@@ -117,7 +116,7 @@ func (retry *retryRequestRouter) Make(request *router.Request, passedResponse *r
117116
}
118117
// detect if body is ioutil.NopCloser(&bytes.Buffer)
119118
// if so we reset the content the buffer to be able to redo request with same body
120-
if reflect.TypeOf(request.Body) == reflect.TypeOf(ioutil.NopCloser) {
119+
if reflect.TypeOf(request.Body) == reflect.TypeOf(io.NopCloser) {
121120
reader := reflect.ValueOf(request.Body).FieldByName("Reader")
122121
if buf, ok := reader.Interface().(*bytes.Buffer); ok {
123122
data := buf.Bytes()

0 commit comments

Comments
 (0)