Satisfy linter

This commit is contained in:
HugeFrog24
2026-05-28 21:01:23 +02:00
parent d97a2c3132
commit a2cc252e8f
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ func (b *Bot) generateSpeech(ctx context.Context, text string) (io.Reader, error
return nil, fmt.Errorf("elevenlabs TTS error: %w", err)
}
if resp.StatusCode != http.StatusOK {
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
errBody, _ := io.ReadAll(resp.Body)
return nil, fmt.Errorf("elevenlabs TTS error: status %d: %s", resp.StatusCode, errBody)
}
@@ -90,7 +90,7 @@ func (b *Bot) transcribeVoice(ctx context.Context, fileID string) (string, error
if err != nil {
return "", fmt.Errorf("elevenlabs STT request error: %w", err)
}
defer sttResp.Body.Close()
defer func() { _ = sttResp.Body.Close() }()
if sttResp.StatusCode != http.StatusOK {
body, _ := io.ReadAll(sttResp.Body)