change: replace ioutil

This commit is contained in:
lilong.129
2024-01-16 21:53:01 +08:00
parent 6c49ce7e3c
commit dce414e892
6 changed files with 93 additions and 13 deletions

View File

@@ -3,7 +3,7 @@
package gadb
import (
"io/ioutil"
"os"
"testing"
)
@@ -116,6 +116,6 @@ func TestScreenCap(t *testing.T) {
t.Error(err)
}
t.Log(len(res))
ioutil.WriteFile("/tmp/1.png", res, 0o644)
os.WriteFile("/tmp/1.png", res, 0o644)
}
}

View File

@@ -4,7 +4,6 @@ package gadb
import (
"bytes"
"io/ioutil"
"os"
"reflect"
"strings"
@@ -244,7 +243,7 @@ func TestDevice_Pull(t *testing.T) {
}
userHomeDir, _ := os.UserHomeDir()
if err = ioutil.WriteFile(userHomeDir+"/Desktop/hello.txt", buffer.Bytes(), DefaultFileMode); err != nil {
if err = os.WriteFile(userHomeDir+"/Desktop/hello.txt", buffer.Bytes(), DefaultFileMode); err != nil {
t.Fatal(err)
}
}