1
0
Fork 0

refactor: remove ioutil (deprecated)

master
dump_stack() 2024-02-20 12:04:24 +00:00
parent d43cd36858
commit b4bf0314f0
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB
1 changed files with 2 additions and 3 deletions

View File

@ -7,7 +7,6 @@ package qemu
import ( import (
"crypto/sha512" "crypto/sha512"
"fmt" "fmt"
"io/ioutil"
"math/rand" "math/rand"
"net" "net"
"os" "os"
@ -159,7 +158,7 @@ func TestSystemCopyFile(t *testing.T) {
localPath := "/bin/sh" localPath := "/bin/sh"
content, err := ioutil.ReadFile(localPath) content, err := os.ReadFile(localPath)
if err != nil { if err != nil {
return return
} }
@ -193,7 +192,7 @@ func TestSystemCopyAndRun(t *testing.T) {
randStr := fmt.Sprintf("%d", rand.Int()) randStr := fmt.Sprintf("%d", rand.Int())
content := []byte("#!/bin/sh\n echo -n " + randStr + "\n") content := []byte("#!/bin/sh\n echo -n " + randStr + "\n")
tmpfile, err := ioutil.TempFile("", "executable") tmpfile, err := os.CreateTemp("", "executable")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }