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

@@ -2,7 +2,7 @@ package adb
import (
"fmt"
"io/ioutil"
"os"
"strings"
"time"
@@ -36,7 +36,7 @@ var screencapAndroidDevicesCmd = &cobra.Command{
}
filepath := fmt.Sprintf("%s.png", builtin.GenNameWithTimestamp("screencap_%d"))
if err = ioutil.WriteFile(filepath, res, 0o644); err != nil {
if err = os.WriteFile(filepath, res, 0o644); err != nil {
return err
}
fmt.Println("screencap saved to", filepath)