Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Replace deprecated io/ioutil with io #651

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package godo
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"reflect"
"strings"
Expand Down Expand Up @@ -233,7 +233,7 @@ func TestProjects_UpdateWithOneAttribute(t *testing.T) {
}

mux.HandleFunc("/v2/projects/project-1", func(w http.ResponseWriter, r *http.Request) {
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("projects mock didn't work")
}
Expand Down Expand Up @@ -278,7 +278,7 @@ func TestProjects_UpdateWithAllAttributes(t *testing.T) {
}

mux.HandleFunc("/v2/projects/project-1", func(w http.ResponseWriter, r *http.Request) {
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("projects mock didn't work")
}
Expand Down Expand Up @@ -505,7 +505,7 @@ func TestProjects_AssignFleetResourcesWithTypes(t *testing.T) {

mux.HandleFunc("/v2/projects/project-1/resources", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPost)
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("projects mock didn't work")
}
Expand Down Expand Up @@ -564,7 +564,7 @@ func TestProjects_AssignFleetResourcesWithStrings(t *testing.T) {

mux.HandleFunc("/v2/projects/project-1/resources", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPost)
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("projects mock didn't work")
}
Expand Down Expand Up @@ -623,7 +623,7 @@ func TestProjects_AssignFleetResourcesWithStringsAndTypes(t *testing.T) {

mux.HandleFunc("/v2/projects/project-1/resources", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPost)
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("projects mock didn't work")
}
Expand Down
6 changes: 3 additions & 3 deletions uptime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package godo
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"reflect"
"strings"
Expand Down Expand Up @@ -251,7 +251,7 @@ func TestUptimeChecks_Update(t *testing.T) {
}

mux.HandleFunc("/v2/uptime/checks/check-id", func(w http.ResponseWriter, r *http.Request) {
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("uptime checks mock didn't work")
}
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestUptimeAlert_Update(t *testing.T) {
}

mux.HandleFunc("/v2/uptime/checks/check-id/alerts/alert-id", func(w http.ResponseWriter, r *http.Request) {
reqBytes, respErr := ioutil.ReadAll(r.Body)
reqBytes, respErr := io.ReadAll(r.Body)
if respErr != nil {
t.Error("alerts mock didn't work")
}
Expand Down
Loading