fix: lint errors

This commit is contained in:
Yiyang Kang 2025-04-17 12:33:13 +09:00
parent 9fbfc0ca82
commit d727d6b68e
Signed by: kkyy
GPG key ID: 80FD317ECAF06CC3
4 changed files with 8 additions and 12 deletions

View file

@ -67,7 +67,7 @@ func (c *Client) ChatCompletionStream(request ChatRequest) (*ChatResponseStream,
}
if resp.StatusCode() != 200 {
defer rbody.Close()
defer func() { _ = rbody.Close() }()
var respBodyStr string
if respBody, err := io.ReadAll(rbody); err == nil {
respBodyStr = string(respBody)
@ -83,7 +83,7 @@ func (c *Client) ChatCompletionStream(request ChatRequest) (*ChatResponseStream,
}
go func() {
defer func() {
rbody.Close()
_ = rbody.Close()
close(ret.Stream)
close(ret.Done)
}()