Skip to content

Commit

Permalink
Remove deprecated io/ioutil method
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Aug 5, 2024
1 parent c3ec76f commit 6968153
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 43 deletions.
69 changes: 34 additions & 35 deletions clients/management/managementclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions clients/treatment/treatmentclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions common/web/web_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package web
import (
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"testing"
"time"
Expand Down Expand Up @@ -44,7 +44,7 @@ func TestFileHandler(t *testing.T) {
require.Equal(t, "no-cache, no-store, must-revalidate", resp.Header.Get("Cache-Control"))
require.Equal(t, "0", resp.Header.Get("Expires"))

respBytes, err := ioutil.ReadAll(resp.Body)
respBytes, err := io.ReadAll(resp.Body)
_ = resp.Body.Close()
require.NoError(t, err)

Expand Down
3 changes: 1 addition & 2 deletions management-service/middleware/authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package middleware

import (
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
Expand All @@ -19,7 +18,7 @@ func TestAuthorizationMiddleware(t *testing.T) {
testHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
require.NoError(t, err)
_, _ = io.WriteString(w, string(body))
})
Expand Down
3 changes: 1 addition & 2 deletions management-service/middleware/openapi_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package middleware

import (
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
Expand Down Expand Up @@ -56,7 +55,7 @@ func TestOpenAPIMiddleware(t *testing.T) {
testHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
require.NoError(t, err)
_, _ = io.WriteString(w, string(body))
})
Expand Down

0 comments on commit 6968153

Please sign in to comment.