aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-kconf
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2023-02-23 14:28:18 +0100
committerGitHub <noreply@github.com>2023-02-23 14:28:18 +0100
commit4359978ef22a22ddd5a19adf18cbc80cb44244fb (patch)
tree7952da94e27417b39ddf952d9e0bab431dafc4c5 /tools/syz-kconf
parent9e2ebb3c174f1e168bc1fbadd5f02f2e25e314fc (diff)
all: ioutil is deprecated in go1.19 (#3718)
Diffstat (limited to 'tools/syz-kconf')
-rw-r--r--tools/syz-kconf/kconf.go5
-rw-r--r--tools/syz-kconf/parser.go6
2 files changed, 5 insertions, 6 deletions
diff --git a/tools/syz-kconf/kconf.go b/tools/syz-kconf/kconf.go
index 0d8c48ac2..9b8c8101d 100644
--- a/tools/syz-kconf/kconf.go
+++ b/tools/syz-kconf/kconf.go
@@ -9,7 +9,6 @@ import (
"errors"
"flag"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"regexp"
@@ -168,7 +167,7 @@ type Context struct {
func (ctx *Context) generate() error {
var err error
- if ctx.BuildDir, err = ioutil.TempDir("", "syz-kconf"); err != nil {
+ if ctx.BuildDir, err = os.MkdirTemp("", "syz-kconf"); err != nil {
return err
}
defer os.RemoveAll(ctx.BuildDir)
@@ -460,7 +459,7 @@ func (ctx *Context) replaceVars(str string) string {
}
func releaseTag(dir string) (string, error) {
- data, err := ioutil.ReadFile(filepath.Join(dir, "Makefile"))
+ data, err := os.ReadFile(filepath.Join(dir, "Makefile"))
if err != nil {
return "", err
}
diff --git a/tools/syz-kconf/parser.go b/tools/syz-kconf/parser.go
index b2ac82e74..05531a227 100644
--- a/tools/syz-kconf/parser.go
+++ b/tools/syz-kconf/parser.go
@@ -6,7 +6,7 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
+ "os"
"path/filepath"
"strconv"
"strings"
@@ -89,7 +89,7 @@ type rawFile struct {
}
func parseMainSpec(file string) ([]*Instance, []string, error) {
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err != nil {
return nil, nil, fmt.Errorf("failed to read config file: %v", err)
}
@@ -159,7 +159,7 @@ func parseInstance(name, configDir string, features []string, includes []map[str
}
func parseFile(file string) (*rawFile, error) {
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err != nil {
return nil, fmt.Errorf("failed to read %v: %v", file, err)
}