Skip to content

Commit

Permalink
Replace deprecated ioutil with other functions (#214)
Browse files Browse the repository at this point in the history
ioutilDeprecated: ioutil.ReadAll is deprecated, use io.ReadAll instead

ioutil.ReadFile is deprecated, use os.ReadFile instead
  • Loading branch information
aminvakil authored Dec 4, 2021
1 parent 2e33312 commit cd6983d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"os"
"os/signal"
"strings"
Expand Down Expand Up @@ -241,7 +240,7 @@ func tlsConfig(c *cli.Context) (*tls.Config, error) {
if caCertFlag != "" {
var caCert []byte
if strings.HasPrefix(caCertFlag, "/") {
caCert, err = ioutil.ReadFile(caCertFlag)
caCert, err = os.ReadFile(caCertFlag)
if err != nil {
return nil, errors.Wrap(err, "unable to read CA certificate")
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/container/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"strings"
"time"
Expand Down Expand Up @@ -167,7 +166,7 @@ func (client dockerClient) ExecContainer(ctx context.Context, c *Container, comm
return errors.Wrap(err, "exec start failed")
}

output, err := ioutil.ReadAll(attachRes.Reader)
output, err := io.ReadAll(attachRes.Reader)
if err != nil {
return errors.Wrap(err, "reading output from exec reader failed")
}
Expand Down

0 comments on commit cd6983d

Please sign in to comment.