Fix golangci-lint errcheck and unused errors
CI / test (push) Failing after 12m57s

- manager.go: add _ = to syscall.Kill and proc.Signal calls (6 fixes)
- chat.go: add _ = to c.Writer.WriteString calls (9 fixes)
- webhook.go: remove unused webhookSecret field
This commit is contained in:
2026-07-30 17:20:34 -04:00
parent e9c81f7c30
commit f775c2f67e
3 changed files with 17 additions and 18 deletions
+9 -9
View File
@@ -180,19 +180,19 @@ func (h *ChatHandler) handleStream(c *gin.Context, apiKey *db.ApiKey, req ChatCo
completionTokens += len(resp.Choices[0].Delta.Content) / 4
// Write SSE
c.Writer.WriteString("data: ")
c.Writer.WriteString("{\"id\":\"chatcmpl-1\",\"object\":\"chat.completion.chunk\",\"created\":")
c.Writer.WriteString(formatInt(resp.Created))
c.Writer.WriteString(",\"model\":\"")
c.Writer.WriteString(resp.Model)
c.Writer.WriteString("\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"")
c.Writer.WriteString(escapeJSON(resp.Choices[0].Delta.Content))
c.Writer.WriteString("\"}}]}\n\n")
_, _ = c.Writer.WriteString("data: ")
_, _ = c.Writer.WriteString("{\"id\":\"chatcmpl-1\",\"object\":\"chat.completion.chunk\",\"created\":")
_, _ = c.Writer.WriteString(formatInt(resp.Created))
_, _ = c.Writer.WriteString(",\"model\":\"")
_, _ = c.Writer.WriteString(resp.Model)
_, _ = c.Writer.WriteString("\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"")
_, _ = c.Writer.WriteString(escapeJSON(resp.Choices[0].Delta.Content))
_, _ = c.Writer.WriteString("\"}}]}\n\n")
flusher.Flush()
case err := <-errCh:
h.logUsage(c, apiKey, req.Model, promptTokens, completionTokens, totalTokens, "error", start)
c.Writer.WriteString("data: [DONE]\n\n")
_, _ = c.Writer.WriteString("data: [DONE]\n\n")
flusher.Flush()
if err != nil {
slog.Error("stream error", "error", err)