mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
Stop using deprecated ioutil functions
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
@@ -25,7 +25,7 @@ type PackageSpec struct {
|
||||
}
|
||||
|
||||
func ReadSpec(fileName string) *ModuleSpec {
|
||||
bytes, err := ioutil.ReadFile(fileName)
|
||||
bytes, err := os.ReadFile(fileName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
package internal_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@@ -51,7 +50,7 @@ func TestReadSpec(t *testing.T) {
|
||||
|
||||
// Write content to temp file, returning file name.
|
||||
func writeFile(t *testing.T, content []byte) string {
|
||||
f, err := ioutil.TempFile("", "testjunk")
|
||||
f, err := os.CreateTemp("", "testjunk")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user