refactor: remove ioutil (deprecated)
This commit is contained in:
parent
d43cd36858
commit
b4bf0314f0
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user