aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/compiler')
-rw-r--r--pkg/compiler/compiler_test.go4
-rw-r--r--pkg/compiler/const_file.go4
-rw-r--r--pkg/compiler/const_file_test.go5
-rw-r--r--pkg/compiler/consts_test.go4
4 files changed, 8 insertions, 9 deletions
diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go
index 79735d10a..be40e817b 100644
--- a/pkg/compiler/compiler_test.go
+++ b/pkg/compiler/compiler_test.go
@@ -7,7 +7,7 @@ import (
"bytes"
"flag"
"fmt"
- "io/ioutil"
+ "os"
"path/filepath"
"reflect"
"sort"
@@ -112,7 +112,7 @@ func TestData(t *testing.T) {
}
if formatted := ast.Format(astDesc); !bytes.Equal(em.Data, formatted) {
if *flagUpdate {
- ioutil.WriteFile(fileName, formatted, 0644)
+ os.WriteFile(fileName, formatted, 0644)
}
t.Fatalf("description is not formatted")
}
diff --git a/pkg/compiler/const_file.go b/pkg/compiler/const_file.go
index 78f3b03f9..0df0bb0ca 100644
--- a/pkg/compiler/const_file.go
+++ b/pkg/compiler/const_file.go
@@ -7,7 +7,7 @@ import (
"bufio"
"bytes"
"fmt"
- "io/ioutil"
+ "os"
"path/filepath"
"regexp"
"sort"
@@ -168,7 +168,7 @@ func DeserializeConstFile(glob string, eh ast.ErrorHandler) *ConstFile {
cf := NewConstFile()
oldFormat := regexp.MustCompile(`_([a-z0-9]+)\.const$`)
for _, f := range files {
- data, err := ioutil.ReadFile(f)
+ data, err := os.ReadFile(f)
if err != nil {
eh(ast.Pos{}, fmt.Sprintf("failed to read const file: %v", err))
return nil
diff --git a/pkg/compiler/const_file_test.go b/pkg/compiler/const_file_test.go
index b38d0795d..ccfce4c95 100644
--- a/pkg/compiler/const_file_test.go
+++ b/pkg/compiler/const_file_test.go
@@ -4,7 +4,6 @@
package compiler
import (
- "io/ioutil"
"os"
"path/filepath"
"testing"
@@ -91,7 +90,7 @@ CONST5_SOME_UNDEFINED2 = 100, arch3:???
t.Fatal(diff)
}
{
- file, err := ioutil.TempFile("", "syz-const")
+ file, err := os.CreateTemp("", "syz-const")
if err != nil {
t.Fatal(err)
}
@@ -112,7 +111,7 @@ CONST5_SOME_UNDEFINED2 = 100, arch3:???
dir := t.TempDir()
for name, arch := range arches {
file := filepath.Join(dir, "consts_"+name+".const")
- if err := ioutil.WriteFile(file, []byte(arch.oldFormat), 0600); err != nil {
+ if err := os.WriteFile(file, []byte(arch.oldFormat), 0600); err != nil {
t.Fatal(err)
}
}
diff --git a/pkg/compiler/consts_test.go b/pkg/compiler/consts_test.go
index 685525bc9..a0e4c1c8d 100644
--- a/pkg/compiler/consts_test.go
+++ b/pkg/compiler/consts_test.go
@@ -4,7 +4,7 @@
package compiler
import (
- "io/ioutil"
+ "os"
"path/filepath"
"reflect"
"sort"
@@ -15,7 +15,7 @@ import (
)
func TestExtractConsts(t *testing.T) {
- data, err := ioutil.ReadFile(filepath.Join("testdata", "consts.txt"))
+ data, err := os.ReadFile(filepath.Join("testdata", "consts.txt"))
if err != nil {
t.Fatalf("failed to read input file: %v", err)
}