This commit is contained in:
laodaming 2023-10-16 10:57:33 +08:00
parent 4a620d46d5
commit 2e421a2968

View File

@ -65,15 +65,15 @@ func ApiCall2(url, method string, header map[string]string, body io.Reader, time
buff := bytes.Buffer{}
reader := bufio.NewReader(rsp.Body)
for {
line, _, err := reader.ReadLine()
if err == io.EOF {
_, err = buff.Write(line)
if err != nil {
return nil, err
}
break
}
line, err := reader.ReadBytes('\n')
if err != nil {
if err == io.EOF {
_, err = buff.Write(line)
if err != nil {
return nil, err
}
break
}
return nil, err
}
_, err = buff.Write(line)