Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove refs to deprecated io/ioutil #145

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/user"
Expand Down Expand Up @@ -89,7 +88,7 @@ func (cmd *adminCmd) parseArgs(as []string) {
cmd.deleteTopic = args.deleteTopic

if cmd.createTopic != "" {
buf, err := ioutil.ReadFile(args.topicDetailPath)
buf, err := os.ReadFile(args.topicDetailPath)
if err != nil {
failf("failed to read topic detail err=%v", err)
}
Expand Down
9 changes: 4 additions & 5 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand Down Expand Up @@ -177,7 +176,7 @@ func setupCerts(certPath, caPath, keyPath string) (*tls.Config, error) {
return nil, err
}

caString, err := ioutil.ReadFile(caPath)
caString, err := os.ReadFile(caPath)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -242,7 +241,7 @@ func setupAuthTLS1Way(auth authConfig, saramaCfg *sarama.Config) error {
return nil
}

caString, err := ioutil.ReadFile(auth.CACert)
caString, err := os.ReadFile(auth.CACert)
if err != nil {
return fmt.Errorf("failed to read ca-certificate err=%v", err)
}
Expand All @@ -265,7 +264,7 @@ func setupAuthTLS(auth authConfig, saramaCfg *sarama.Config) error {
return fmt.Errorf("client-certificate, client-certificate-key and ca-certificate are required - got auth=%#v", auth)
}

caString, err := ioutil.ReadFile(auth.CACert)
caString, err := os.ReadFile(auth.CACert)
if err != nil {
return fmt.Errorf("failed to read ca-certificate err=%v", err)
}
Expand Down Expand Up @@ -306,7 +305,7 @@ func readAuthFile(argFN string, envFN string, target *authConfig) {
fn = envFN
}

byts, err := ioutil.ReadFile(fn)
byts, err := os.ReadFile(fn)
if err != nil {
failf("failed to read auth file err=%v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"sort"
Expand Down Expand Up @@ -76,7 +75,7 @@ func TestSystem(t *testing.T) {
buf, err := json.Marshal(topicDetail)
require.NoError(t, err)
fnTopicDetail := fmt.Sprintf("topic-detail-%v.json", randomString(6))
err = ioutil.WriteFile(fnTopicDetail, buf, 0666)
err = os.WriteFile(fnTopicDetail, buf, 0666)
require.NoError(t, err)
defer os.RemoveAll(fnTopicDetail)

Expand Down
Loading