Skip to content

Commit

Permalink
chore: remove use of io/ioutil
Browse files Browse the repository at this point in the history
Removes the use of `io/ioutil`.

As of Go 1.16, the same functionality is now provided by package `io` or package `os`, and those implementations are preferred in new code.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam committed Jan 8, 2025
1 parent d7712eb commit e65b291
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nsxt/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"math/rand"
"net/http"
Expand Down Expand Up @@ -722,7 +722,7 @@ func (v *vmcAuthInfo) getAPIToken() (string, error) {
return "", err
}
if res.StatusCode != 200 {
b, _ := ioutil.ReadAll(res.Body)
b, _ := io.ReadAll(res.Body)
return "", fmt.Errorf("unexpected status code %d trying to get auth token. %s", res.StatusCode, string(b))
}

Expand Down Expand Up @@ -784,7 +784,7 @@ func getConnectorTLSConfig(d *schema.ResourceData) (*tls.Config, error) {
}

if len(caFile) > 0 {
caCert, err := ioutil.ReadFile(caFile)
caCert, err := os.ReadFile(caFile)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e65b291

Please sign in to comment.