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

remove ioutil - deprecated in go 1.16 #3

Merged
merged 1 commit into from
Feb 24, 2023
Merged
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
11 changes: 5 additions & 6 deletions logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -207,7 +206,7 @@ var _ = Describe("CNI Logging Operations", func() {
AfterEach(func() {
// Clear contents of file
data := []byte("")
err := ioutil.WriteFile(logFile, data, 0)
err := os.WriteFile(logFile, data, 0)
Expect(err).ToNot(HaveOccurred())
})

Expand Down Expand Up @@ -276,7 +275,7 @@ var _ = Describe("CNI Logging Operations", func() {
AfterEach(func() {
// Clear contents of file
data := []byte("")
err := ioutil.WriteFile(logFile, data, 0)
err := os.WriteFile(logFile, data, 0)
Expect(err).ToNot(HaveOccurred())
})

Expand Down Expand Up @@ -421,7 +420,7 @@ var _ = Describe("CNI Logging Operations", func() {
AfterEach(func() {
// Clear contents of file
data := []byte("")
err := ioutil.WriteFile(logFile, data, 0)
err := os.WriteFile(logFile, data, 0)
Expect(err).ToNot(HaveOccurred())
})

Expand Down Expand Up @@ -481,7 +480,7 @@ func validateLogFilePrefix(filename string, prefix string) bool {
Infof(infoMsg)

// Read in contents of file
contents, err := ioutil.ReadFile(filename)
contents, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
Expand All @@ -505,7 +504,7 @@ func validateLogFile(logLevel string, filename string) bool {
Verbosef(verboseMsg)

// Read in the log file
contents, err := ioutil.ReadFile(filename)
contents, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
Expand Down