fix: handle errcheck for Rows.Close and resp.Body.Close in sora code

This commit is contained in:
erio
2026-03-10 18:16:58 +08:00
parent 7b3df5b807
commit a4fdc1dc4b
2 changed files with 2 additions and 2 deletions
@@ -90,7 +90,7 @@ func (r *SoraTaskRepository) ListPending(ctx context.Context) ([]*service.SoraTa
if err != nil {
return nil, err
}
defer rows.Close()
defer func() { _ = rows.Close() }()
var tasks []*service.SoraTask
for rows.Next() {
@@ -379,7 +379,7 @@ func (s *SoraTaskService) forwardGetToUpstream(
if err != nil {
return nil, fmt.Errorf("upstream request: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
respBody, err := io.ReadAll(io.LimitReader(resp.Body, 256*1024))
if err != nil {