Skip to content

Commit 8ac066f

Browse files
authored
Deprecation of package ioutil in Go 1.16. golang/go#42026 (#164)
1 parent 8231733 commit 8ac066f

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

pkg/admin/connector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"crypto/tls"
55
"crypto/x509"
66
"fmt"
7-
"io/ioutil"
7+
"os"
88
"strings"
99
"time"
1010

@@ -132,7 +132,7 @@ func NewConnector(config ConnectorConfig) (*Connector, error) {
132132
if config.TLS.CACertPath != "" {
133133
log.Debugf("Adding CA certs from %s", config.TLS.CACertPath)
134134
caCertPool = x509.NewCertPool()
135-
caCertContents, err := ioutil.ReadFile(config.TLS.CACertPath)
135+
caCertContents, err := os.ReadFile(config.TLS.CACertPath)
136136
if err != nil {
137137
return nil, err
138138
}

pkg/cli/cli.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cli
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
76
"os"
87
"path/filepath"
98
"regexp"
@@ -177,7 +176,7 @@ func (c *CLIRunner) BootstrapTopics(
177176

178177
if isNew || overwrite {
179178
log.Infof("Writing config to %s", outputPath)
180-
err = ioutil.WriteFile(outputPath, []byte(yamlStr), 0644)
179+
err = os.WriteFile(outputPath, []byte(yamlStr), 0644)
181180
if err != nil {
182181
return err
183182
}

pkg/config/load.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"encoding/json"
66
"errors"
7-
"io/ioutil"
87
"os"
98
"path/filepath"
109
"regexp"
@@ -18,7 +17,7 @@ var sep = regexp.MustCompile("(?:^|\\s*\n)---\\s*")
1817

1918
// LoadClusterFile loads a ClusterConfig from a path to a YAML file.
2019
func LoadClusterFile(path string, expandEnv bool) (ClusterConfig, error) {
21-
contents, err := ioutil.ReadFile(path)
20+
contents, err := os.ReadFile(path)
2221
if err != nil {
2322
return ClusterConfig{}, err
2423
}
@@ -50,7 +49,7 @@ func LoadClusterBytes(contents []byte) (ClusterConfig, error) {
5049

5150
// LoadTopicsFile loads one or more TopicConfigs from a path to a YAML file.
5251
func LoadTopicsFile(path string) ([]TopicConfig, error) {
53-
contents, err := ioutil.ReadFile(path)
52+
contents, err := os.ReadFile(path)
5453
if err != nil {
5554
return nil, err
5655
}

0 commit comments

Comments
 (0)