From fca8155734db51cc16371939186a9914578a9081 Mon Sep 17 00:00:00 2001 From: Peter Birch Date: Mon, 18 Dec 2023 19:11:24 +1100 Subject: [PATCH] remove deprecated ioutil calls --- test/goyamp_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/goyamp_test.go b/test/goyamp_test.go index 5f46266..f634b49 100644 --- a/test/goyamp_test.go +++ b/test/goyamp_test.go @@ -6,7 +6,6 @@ import ( "fmt" "github.com/birchb1024/goyamp/internal" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -40,13 +39,13 @@ func runTestFiles(name string, fileList []string, format internal.Syntax, t *tes t.Error(path, err) return } - expected, err := ioutil.ReadFile(logFile) + expected, err := os.ReadFile(logFile) if err != nil { t.Error(path, err) return } if result.String() != string(expected) { - err := ioutil.WriteFile("/tmp/"+filename+".logFile", result.Bytes(), 0644) + err := os.WriteFile("/tmp/"+filename+".logFile", result.Bytes(), 0644) if err != nil { panic(err) } @@ -136,7 +135,7 @@ func TestMain(m *testing.M) { flag.BoolVar(&debugFlag, "d", false, "output debug strings") flag.Parse() if !debugFlag { - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) } os.Exit(m.Run())