Skip to content

Commit

Permalink
test: Replace deprecated io/ioutil with io (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Oct 23, 2023
1 parent 2e44069 commit fbe4351
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
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

0 comments on commit fbe4351

Please sign in to comment.