44 "bytes"
55 "encoding/json"
66 "fmt"
7- "io/ioutil"
87 "os"
98 "os/exec"
109 "strings"
@@ -79,11 +78,11 @@ func exportInitialState(t *testing.T, testProjectName string, tailorBinary strin
7978 if exportErr != nil {
8079 t .Fatalf ("Could not export initial state: %s\n %s" , exportErr , exportStderr )
8180 }
82- tempDir , tempDirErr := ioutil . TempDir (".." , "initial-export-" )
81+ tempDir , tempDirErr := os . MkdirTemp (".." , "initial-export-" )
8382 if tempDirErr != nil {
8483 t .Fatalf ("Could not create temp dir: %s" , tempDirErr )
8584 }
86- writeErr := ioutil .WriteFile (tempDir + "/template.yml" , exportStdout , 0644 )
85+ writeErr := os .WriteFile (tempDir + "/template.yml" , exportStdout , 0644 )
8786 if writeErr != nil {
8887 t .Logf ("Failed to write file template.yml into %s" , tempDir )
8988 os .RemoveAll (tempDir )
@@ -93,7 +92,7 @@ func exportInitialState(t *testing.T, testProjectName string, tailorBinary strin
9392}
9493
9594func walkSubdirs (t * testing.T , dir string , fun func (subdir string )) {
96- files , err := ioutil .ReadDir (dir )
95+ files , err := os .ReadDir (dir )
9796 if err != nil {
9897 t .Fatal (err )
9998 }
@@ -262,7 +261,7 @@ func runCmd(executable string, args []string) (outBytes, errBytes []byte, err er
262261}
263262
264263func readTestCaseSteps (folder string ) (testCaseSteps , error ) {
265- content , err := ioutil .ReadFile (folder + "/steps.json" )
264+ content , err := os .ReadFile (folder + "/steps.json" )
266265 if err != nil {
267266 return nil , fmt .Errorf ("Cannot read file: %w" , err )
268267 }
0 commit comments