refactor: replace uses of ioutil with io and os (#223)

This commit is contained in:
Daniel Moran
2021-08-04 14:45:22 -04:00
committed by GitHub
parent aafdda744d
commit d615694ee9
38 changed files with 227 additions and 240 deletions

View File

@ -3,7 +3,6 @@ package api_test
import (
"compress/gzip"
"io"
"io/ioutil"
"net/http"
"strings"
"testing"
@ -28,7 +27,7 @@ func TestGunzipIfNeeded(t *testing.T) {
{
name: "no gzip",
getBody: func(t *testing.T) io.ReadCloser {
return ioutil.NopCloser(strings.NewReader(exampleResponse))
return io.NopCloser(strings.NewReader(exampleResponse))
},
},
{
@ -67,7 +66,7 @@ func TestGunzipIfNeeded(t *testing.T) {
raw, err := api.GunzipIfNeeded(&resp)
require.NoError(t, err)
defer raw.Close()
body, err := ioutil.ReadAll(raw)
body, err := io.ReadAll(raw)
require.NoError(t, err)
require.Equal(t, exampleResponse, string(body))
})