Skip to content

Commit 3e6195e

Browse files
committed
drop io/ioutil
1 parent d674f26 commit 3e6195e

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

cloud/linode/fake_linode_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7-
"io/ioutil"
7+
"io"
88
"math/rand"
99
"net"
1010
"net/http"
@@ -49,9 +49,9 @@ func (f *fakeAPI) ResetRequests() {
4949
}
5050

5151
func (f *fakeAPI) recordRequest(r *http.Request, urlPath string) {
52-
bodyBytes, _ := ioutil.ReadAll(r.Body)
52+
bodyBytes, _ := io.ReadAll(r.Body)
5353
r.Body.Close()
54-
r.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes))
54+
r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
5555
f.requests[fakeRequest{
5656
Path: urlPath,
5757
Method: r.Method,

e2e/test/framework/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"crypto/tls"
66
"crypto/x509"
7-
"io/ioutil"
7+
"io"
88
"log"
99
"net"
1010
"net/http"
@@ -128,7 +128,7 @@ func getHTTPSResponse(domain, ip, port string) (string, error) {
128128
}
129129
defer resp.Body.Close()
130130

131-
bodyBytes, err := ioutil.ReadAll(resp.Body)
131+
bodyBytes, err := io.ReadAll(resp.Body)
132132
if err != nil {
133133
return "", err
134134
}
@@ -155,7 +155,7 @@ func getHTTPResponse(link string) (bool, string, error) {
155155
}
156156
defer resp.Body.Close()
157157

158-
bodyBytes, err := ioutil.ReadAll(resp.Body)
158+
bodyBytes, err := io.ReadAll(resp.Body)
159159
if err != nil {
160160
return false, "", err
161161
}

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,10 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q
455455
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
456456
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
457457
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
458-
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
459-
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
460458
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
461459
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
462460
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
463461
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
464-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
465-
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
466462
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
467463
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
468464
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=

0 commit comments

Comments
 (0)