Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions fmttests/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
goErr "errors"
"flag"
"fmt"
"io/ioutil"
"net"
"os"
"regexp"
Expand Down Expand Up @@ -385,7 +384,7 @@ func generateFiles() {
}
leafTests.WriteString("----\n\n")
}
ioutil.WriteFile(testPath+"/leaves", leafTests.Bytes(), 0666)
os.WriteFile(testPath+"/leaves", leafTests.Bytes(), 0666)

// Generate the "leaves-via-network" input file, which tests
// formatting for leaf-only error types after being brought over
Expand All @@ -405,7 +404,7 @@ func generateFiles() {
}
leafTests.WriteString("----\n\n")
}
ioutil.WriteFile(testPath+"/leaves-via-network", leafTests.Bytes(), 0666)
os.WriteFile(testPath+"/leaves-via-network", leafTests.Bytes(), 0666)

// Leaf types for which we want to test all wrappers:
wrapperLeafTypes := []string{"fmt", "goerr", "nofmt", "pkgerr", "newf"}
Expand Down Expand Up @@ -449,7 +448,7 @@ func generateFiles() {
}
wrapTests.WriteString("----\n\n")
}
ioutil.WriteFile(
os.WriteFile(
fmt.Sprintf(testPath+"/wrap-%s", leafName),
wrapTests.Bytes(), 0666)
}
Expand Down Expand Up @@ -490,7 +489,7 @@ func generateFiles() {
}
wrapTests.WriteString("----\n\n")
}
ioutil.WriteFile(
os.WriteFile(
fmt.Sprintf(testPath+"/wrap-%s-via-network", leafName),
wrapTests.Bytes(), 0666)
}
Expand Down
4 changes: 2 additions & 2 deletions testutils/simplecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package testutils
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"reflect"
"regexp"
"runtime"
Expand Down Expand Up @@ -212,7 +212,7 @@ func fileContext(filename string, line, context int) ([][]byte, int) {
defer fileCacheLock.Unlock()
lines, ok := fileCache[filename]
if !ok {
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
// cache errors as nil slice: code below handles it correctly
// otherwise when missing the source or running as a different user, we try
Expand Down