1
0
mirror of https://github.com/nginxinc/nginx-prometheus-exporter.git synced 2025-07-31 21:04:21 +03:00

Stop using io/ioutil

This commit is contained in:
inosato
2021-05-01 12:23:46 +09:00
parent a4656a8726
commit 8e98ee44b2
2 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,7 @@ package client
import (
"fmt"
"io/ioutil"
"io"
"net/http"
"strconv"
"strings"
@ -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)
}

View File

@ -6,7 +6,6 @@ import (
"crypto/x509"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
@ -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)
}