mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
修复一些小问题
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"mime/multipart"
|
||||
"mime/quotedprintable"
|
||||
@@ -259,7 +258,7 @@ func TestEmailTextAttachment(t *testing.T) {
|
||||
} else if mt != "text/plain" {
|
||||
t.Fatal("Message missing text/plain")
|
||||
}
|
||||
plainText, err := ioutil.ReadAll(text)
|
||||
plainText, err := io.ReadAll(text)
|
||||
if err != nil {
|
||||
t.Fatal("Could not read plain text component of message: ", err)
|
||||
}
|
||||
@@ -325,7 +324,7 @@ func TestEmailTextHtmlAttachment(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal("Could not read plain text component of message: ", err)
|
||||
}
|
||||
plainText, err := ioutil.ReadAll(part)
|
||||
plainText, err := io.ReadAll(part)
|
||||
if err != nil {
|
||||
t.Fatal("Could not read plain text component of message: ", err)
|
||||
}
|
||||
@@ -875,7 +874,7 @@ func Test_quotedPrintDecode(t *testing.T) {
|
||||
"There are some wacky parts like =, and this input assumes UNIX line breaks so\r\n" +
|
||||
"it can come out a little weird. Also, we need to support unicode so here's a fish: 🐟\r\n")
|
||||
qp := quotedprintable.NewReader(bytes.NewReader(text))
|
||||
got, err := ioutil.ReadAll(qp)
|
||||
got, err := io.ReadAll(qp)
|
||||
if err != nil {
|
||||
t.Fatal("quotePrintDecode: ", err)
|
||||
}
|
||||
@@ -892,7 +891,7 @@ func Benchmark_base64Wrap(b *testing.B) {
|
||||
panic(err)
|
||||
}
|
||||
for i := 0; i <= b.N; i++ {
|
||||
base64Wrap(ioutil.Discard, file)
|
||||
base64Wrap(io.Discard, file)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package httpclient
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
@@ -31,7 +31,7 @@ func Get[T any](url string, token string) (*T, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data, err := ioutil.ReadAll(rsp.Body)
|
||||
data, err := io.ReadAll(rsp.Body)
|
||||
_ = rsp.Body.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -61,7 +61,7 @@ func Post[T any](url string, body any, token string) (*T, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rspData, err := ioutil.ReadAll(rsp.Body)
|
||||
rspData, err := io.ReadAll(rsp.Body)
|
||||
_ = rsp.Body.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user