Skip to content

Commit

Permalink
Remove ioutil (#650)
Browse files Browse the repository at this point in the history
Signed-off-by: inosato <[email protected]>
  • Loading branch information
inosato authored Jul 28, 2022
1 parent 4e46dd9 commit 2898735
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
Expand Down Expand Up @@ -153,7 +152,7 @@ func parseMycnf(config interface{}) (string, error) {
func customizeTLS(sslCA string, sslCert string, sslKey string) error {
var tlsCfg tls.Config
caBundle := x509.NewCertPool()
pemCA, err := ioutil.ReadFile(sslCA)
pemCA, err := os.ReadFile(sslCA)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions mysqld_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestBin(t *testing.T) {
var err error
binName := "mysqld_exporter"

binDir, err := ioutil.TempDir("/tmp", binName+"-test-bindir-")
binDir, err := os.MkdirTemp("/tmp", binName+"-test-bindir-")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -294,7 +294,7 @@ func getBody(urlToGet string) ([]byte, error) {
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 2898735

Please sign in to comment.