fix
This commit is contained in:
parent
4a620d46d5
commit
2e421a2968
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user