Merge pull request #6598 from wallrj/deprecations-2

Use io instead of deprecated ioutil package
This commit is contained in:
jetstack-bot 2024-01-04 15:45:02 +00:00 committed by GitHub
commit f64fdcd41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -34,4 +34,4 @@ issues:
text: "SA(1002|1006|4000|4006)"
- linters:
- staticcheck
text: "(ioutil|KubeCtl|NewCertManagerBasicCertificate|DeprecatedCertificateTemplateFromCertificateRequestAndAllowInsecureCSRUsageDefinition|eab.KeyAlgorithm|testCA.Subjects|RootCAs.Subjects|pki.GenerateTemplate|adal.NewServicePrincipalTokenFromFederatedToken|azure-sdk-for-go|c.SingleInflight|x509.ParseCRL|v.client.RawRequest)"
text: "(KubeCtl|NewCertManagerBasicCertificate|DeprecatedCertificateTemplateFromCertificateRequestAndAllowInsecureCSRUsageDefinition|eab.KeyAlgorithm|testCA.Subjects|RootCAs.Subjects|pki.GenerateTemplate|adal.NewServicePrincipalTokenFromFederatedToken|azure-sdk-for-go|c.SingleInflight|x509.ParseCRL|v.client.RawRequest)"

View File

@ -20,7 +20,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"sync"
@ -281,7 +281,7 @@ func TestHealthzLivezLeaderElection(t *testing.T) {
defer func() {
require.NoError(t, resp.Body.Close())
}()
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
require.NoError(t, err)
lastResponseCode = resp.StatusCode

View File

@ -12,7 +12,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"strings"
@ -255,7 +255,7 @@ func (c *httpDNSClient) Exchange(ctx context.Context, m *dns.Msg, a string) (r *
return nil, 0, fmt.Errorf("dns: unexpected Content-Type %q; expected %q", ct, dohMimeType)
}
p, err = ioutil.ReadAll(resp.Body)
p, err = io.ReadAll(resp.Body)
if err != nil {
return nil, 0, err
}