Skip to content

Commit

Permalink
Stop using io/ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
inosato committed May 6, 2021
1 parent a4656a8 commit 8e98ee4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"strconv"
"strings"
Expand Down Expand Up @@ -53,7 +53,7 @@ func (client *NginxClient) GetStubStats() (*StubStats, error) {
return nil, fmt.Errorf("expected %v response, got %v", http.StatusOK, resp.StatusCode)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read the response body: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"crypto/x509"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -327,7 +326,7 @@ func main() {

sslConfig := &tls.Config{InsecureSkipVerify: !*sslVerify}
if *sslCaCert != "" {
caCert, err := ioutil.ReadFile(*sslCaCert)
caCert, err := os.ReadFile(*sslCaCert)
if err != nil {
log.Fatalf("Loading CA cert failed: %v", err)
}
Expand Down

0 comments on commit 8e98ee4

Please sign in to comment.