mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
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:
@@ -18,7 +18,7 @@ package plugin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
@@ -51,7 +51,7 @@ var _ = Describe("Test Kubectl Plugin", func() {
|
||||
}, 5*time.Second).Should(BeNil())
|
||||
|
||||
By("dry-run application")
|
||||
err := ioutil.WriteFile("dry-run-app.yaml", []byte(application), 0644)
|
||||
err := os.WriteFile("dry-run-app.yaml", []byte(application), 0644)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
output, err := e2e.Exec("kubectl-vela dry-run -f dry-run-app.yaml -n vela-system")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
@@ -91,7 +91,7 @@ var _ = Describe("Test Kubectl Plugin", func() {
|
||||
}, 5*time.Second).Should(BeNil())
|
||||
|
||||
By("live-diff application")
|
||||
err := ioutil.WriteFile("live-diff-app.yaml", []byte(newApplication), 0644)
|
||||
err := os.WriteFile("live-diff-app.yaml", []byte(newApplication), 0644)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
output, err := e2e.Exec("kubectl-vela live-diff -f live-diff-app.yaml")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
Reference in New Issue
Block a user