fix: resolve golangci-lint errcheck warnings
Some checks failed
CI / Test (push) Has been cancelled
CI / Release (push) Has been cancelled
CI / Docker Build & Push (push) Has been cancelled
CI / Notify (push) Has been cancelled
CI / Lint (push) Has been cancelled

- Add error checks for unchecked return values (errcheck)
- Remove unused struct fields (unused)
- Fix gofmt formatting issues
This commit is contained in:
2026-02-20 08:45:44 -05:00
parent 152a84d7e5
commit dbaabe1f65
3 changed files with 13 additions and 13 deletions

View File

@@ -150,12 +150,12 @@ func TestTranscriptionE2E_MockWhisper(t *testing.T) {
if err != nil {
t.Errorf("missing 'file' field: %v", err)
} else {
file.Close()
_ = file.Close()
}
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{"text": "hello world"})
_ = json.NewEncoder(w).Encode(map[string]string{"text": "hello world"})
}))
defer whisperSrv.Close()
@@ -166,20 +166,20 @@ func TestTranscriptionE2E_MockWhisper(t *testing.T) {
if err != nil {
t.Fatal(err)
}
part.Write(make([]byte, 8000)) // simulated audio
writer.Close()
_, _ = part.Write(make([]byte, 8000)) // simulated audio
_ = writer.Close()
resp, err := http.Post(whisperSrv.URL+"/v1/audio/transcriptions", writer.FormDataContentType(), &buf)
if err != nil {
t.Fatal(err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != 200 {
t.Errorf("status = %d", resp.StatusCode)
}
var result map[string]string
json.NewDecoder(resp.Body).Decode(&result)
_ = json.NewDecoder(resp.Body).Decode(&result)
if result["text"] != "hello world" {
t.Errorf("text = %q, want %q", result["text"], "hello world")
}