55 "errors"
66 "fmt"
77 "io"
8- "io/ioutil"
98 "mime"
109 "net/http"
1110 "net/url"
@@ -45,7 +44,7 @@ func (r *Response) Close() error {
4544 if r .Output != nil {
4645
4746 // drain output (response body)
48- _ , err1 := io .Copy (ioutil .Discard , r .Output )
47+ _ , err1 := io .Copy (io .Discard , r .Output )
4948 err2 := r .Output .Close ()
5049 if err1 != nil {
5150 return err1
@@ -117,7 +116,7 @@ func (r *Request) Send(c *http.Client) (*Response, error) {
117116 case resp .StatusCode == http .StatusNotFound :
118117 e .Message = "command not found"
119118 case contentType == "text/plain" :
120- out , err := ioutil .ReadAll (resp .Body )
119+ out , err := io .ReadAll (resp .Body )
121120 if err != nil {
122121 fmt .Fprintf (os .Stderr , "ipfs-shell: warning! response (%d) read error: %s\n " , resp .StatusCode , err )
123122 }
@@ -140,7 +139,7 @@ func (r *Request) Send(c *http.Client) (*Response, error) {
140139 // This is a server-side bug (probably).
141140 e .Code = cmds .ErrImplementation
142141 fmt .Fprintf (os .Stderr , "ipfs-shell: warning! unhandled response (%d) encoding: %s" , resp .StatusCode , contentType )
143- out , err := ioutil .ReadAll (resp .Body )
142+ out , err := io .ReadAll (resp .Body )
144143 if err != nil {
145144 fmt .Fprintf (os .Stderr , "ipfs-shell: response (%d) read error: %s\n " , resp .StatusCode , err )
146145 }
@@ -150,7 +149,7 @@ func (r *Request) Send(c *http.Client) (*Response, error) {
150149 nresp .Output = nil
151150
152151 // drain body and close
153- _ , _ = io .Copy (ioutil .Discard , resp .Body )
152+ _ , _ = io .Copy (io .Discard , resp .Body )
154153 _ = resp .Body .Close ()
155154 }
156155
0 commit comments