From 876e612975298983181b0f19541bb09bb913992c Mon Sep 17 00:00:00 2001 From: "cnb.asek4HHRAKA" Date: Wed, 1 Oct 2025 21:00:55 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=BF=E6=8D=A2=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E7=9A=84=20ioutil=20=E5=8C=85=E4=B8=BA=20io=20=E5=8C=85?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E5=AF=BC=E5=85=A5=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/utils.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/utils.go b/script/utils.go index 943ba54..4734592 100644 --- a/script/utils.go +++ b/script/utils.go @@ -2,13 +2,14 @@ package script import ( "bytes" - "golang.org/x/text/encoding/simplifiedchinese" - "golang.org/x/text/transform" - "io/ioutil" + "io" "math/rand" "net" "os/exec" "time" + + "golang.org/x/text/encoding/simplifiedchinese" + "golang.org/x/text/transform" ) func checkCommandExists(command string) bool { @@ -97,7 +98,7 @@ func ConvertGBKToUTF8(gbkStr string) (string, error) { reader := transform.NewReader(bytes.NewReader([]byte(gbkStr)), simplifiedchinese.GBK.NewDecoder()) // 将转换后的内容读出为 UTF-8 字符串 - utf8Bytes, err := ioutil.ReadAll(reader) + utf8Bytes, err := io.ReadAll(reader) if err != nil { return "", err }