Skip to content

Commit

Permalink
remove deprecated ioutil calls
Browse files Browse the repository at this point in the history
  • Loading branch information
birchb1024 committed Dec 18, 2023
1 parent 477f078 commit fca8155
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/goyamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"github.com/birchb1024/goyamp/internal"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit fca8155

Please sign in to comment.