From 4359978ef22a22ddd5a19adf18cbc80cb44244fb Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 23 Feb 2023 14:28:18 +0100 Subject: all: ioutil is deprecated in go1.19 (#3718) --- tools/syz-reporter/reporter.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tools/syz-reporter') diff --git a/tools/syz-reporter/reporter.go b/tools/syz-reporter/reporter.go index e0d88c1a6..f9d482c6b 100644 --- a/tools/syz-reporter/reporter.go +++ b/tools/syz-reporter/reporter.go @@ -15,7 +15,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "log" "os" "os/exec" @@ -140,7 +139,7 @@ func readCrash(workdir, dir string) *UICrashType { return nil } defer descFile.Close() - descBytes, err := ioutil.ReadAll(descFile) + descBytes, err := io.ReadAll(descFile) if err != nil || len(descBytes) == 0 { return nil } @@ -168,7 +167,7 @@ func readCrash(workdir, dir string) *UICrashType { } if strings.HasPrefix(f, "tag") { - tag, err := ioutil.ReadFile(filepath.Join(crashdir, dir, f)) + tag, err := os.ReadFile(filepath.Join(crashdir, dir, f)) if err == nil { reproducers[string(tag)] = string(tag) } @@ -179,19 +178,19 @@ func readCrash(workdir, dir string) *UICrashType { } if f == "cause.commit" { - commits, err := ioutil.ReadFile(filepath.Join(crashdir, dir, f)) + commits, err := os.ReadFile(filepath.Join(crashdir, dir, f)) if err == nil { causingCommits = strings.Split(string(commits), "\n") } } if f == "fix.commit" { - commits, err := ioutil.ReadFile(filepath.Join(crashdir, dir, f)) + commits, err := os.ReadFile(filepath.Join(crashdir, dir, f)) if err == nil { fixingCommits = strings.Split(string(commits), "\n") } } if f == kconfig.CauseConfigFile { - configs, err := ioutil.ReadFile(filepath.Join(crashdir, dir, f)) + configs, err := os.ReadFile(filepath.Join(crashdir, dir, f)) if err == nil { configsList := strings.Split(string(configs), "\n") // Ignore configuration list longer than 10 -- cgit mrf-deployment