aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build
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 /pkg/build
parent9e2ebb3c174f1e168bc1fbadd5f02f2e25e314fc (diff)
all: ioutil is deprecated in go1.19 (#3718)
Diffstat (limited to 'pkg/build')
-rw-r--r--pkg/build/cuttlefish.go4
-rw-r--r--pkg/build/linux.go5
-rw-r--r--pkg/build/linux_linux.go3
3 files changed, 5 insertions, 7 deletions
diff --git a/pkg/build/cuttlefish.go b/pkg/build/cuttlefish.go
index 42ec8af26..3777467a8 100644
--- a/pkg/build/cuttlefish.go
+++ b/pkg/build/cuttlefish.go
@@ -7,7 +7,7 @@ import (
"archive/tar"
"compress/gzip"
"fmt"
- "io/ioutil"
+ "io"
"os"
"path/filepath"
"strings"
@@ -58,7 +58,7 @@ func (c cuttlefish) readCompiler(archivePath string) (string, error) {
h, err := tr.Next()
for ; err == nil; h, err = tr.Next() {
if filepath.Base(h.Name) == "compile.h" {
- bytes, err := ioutil.ReadAll(tr)
+ bytes, err := io.ReadAll(tr)
if err != nil {
return "", err
}
diff --git a/pkg/build/linux.go b/pkg/build/linux.go
index bb6e66ef3..112e2dfab 100644
--- a/pkg/build/linux.go
+++ b/pkg/build/linux.go
@@ -10,7 +10,6 @@ import (
"debug/elf"
"encoding/hex"
"fmt"
- "io/ioutil"
"os"
"path"
"path/filepath"
@@ -114,7 +113,7 @@ func (linux linux) buildKernel(params Params) error {
}
func (linux) createImage(params Params, kernelPath string) error {
- tempDir, err := ioutil.TempDir("", "syz-build")
+ tempDir, err := os.MkdirTemp("", "syz-build")
if err != nil {
return err
}
@@ -239,7 +238,7 @@ func LinuxKernelImage(arch string) string {
var linuxCompilerRegexp = regexp.MustCompile(`#define\s+LINUX_COMPILER\s+"(.*)"`)
func queryLinuxCompiler(kernelDir string) (string, error) {
- bytes, err := ioutil.ReadFile(filepath.Join(kernelDir, "include", "generated", "compile.h"))
+ bytes, err := os.ReadFile(filepath.Join(kernelDir, "include", "generated", "compile.h"))
if err != nil {
return "", err
}
diff --git a/pkg/build/linux_linux.go b/pkg/build/linux_linux.go
index 55f21a7ee..d22fea678 100644
--- a/pkg/build/linux_linux.go
+++ b/pkg/build/linux_linux.go
@@ -5,7 +5,6 @@ package build
import (
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"syscall"
@@ -37,7 +36,7 @@ func embedFiles(params Params, callback func(mountDir string) error) error {
if params.CmdlineFile != "" {
return fmt.Errorf("cmdline file is not supported for linux images")
}
- tempDir, err := ioutil.TempDir("", "syz-build")
+ tempDir, err := os.MkdirTemp("", "syz-build")
if err != nil {
return err
}