Refactor: move from io/ioutil to io and os package (#2234)

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <zerjun@beatchain.co>
This commit is contained in:
Eng Zer Jun
2021-09-06 18:33:42 +08:00
committed by GitHub
parent f8ac24db27
commit 426aa7af34
49 changed files with 143 additions and 171 deletions
+1 -2
View File
@@ -17,7 +17,6 @@ limitations under the License.
package main
import (
"io/ioutil"
"os"
"testing"
"time"
@@ -72,7 +71,7 @@ var _ = Describe("test waitSecretVolume", func() {
By("add non-empty file")
_, err := os.Create(testdir + "/file")
Expect(err).NotTo(HaveOccurred())
err = ioutil.WriteFile(testdir+"/file", []byte("test"), os.ModeAppend)
err = os.WriteFile(testdir+"/file", []byte("test"), os.ModeAppend)
Expect(err).NotTo(HaveOccurred())
err = waitWebhookSecretVolume(testdir, testTimeout, testInterval)
Expect(err).NotTo(HaveOccurred())