fix: resolve golangci-lint errcheck warnings
Some checks failed
CI / Release (push) Has been cancelled
CI / Docker Build & Push (push) Has been cancelled
CI / Notify (push) Has been cancelled
CI / Test (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:25 -05:00
parent 509f392185
commit de4fa6ea90
3 changed files with 15 additions and 15 deletions

View File

@@ -19,8 +19,8 @@ func TestSubmitArgoE2E_FullPayload(t *testing.T) {
var receivedBody map[string]any
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
json.NewDecoder(r.Body).Decode(&receivedBody)
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewDecoder(r.Body).Decode(&receivedBody)
_ = json.NewEncoder(w).Encode(map[string]any{
"metadata": map[string]any{"name": "doc-ingest-xyz"},
})
}))
@@ -72,8 +72,8 @@ func TestSubmitKubeflowE2E_FullPayload(t *testing.T) {
var receivedBody map[string]any
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
json.NewDecoder(r.Body).Decode(&receivedBody)
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewDecoder(r.Body).Decode(&receivedBody)
_ = json.NewEncoder(w).Encode(map[string]any{
"run": map[string]any{"id": "kf-run-e2e-789"},
})
}))
@@ -150,7 +150,7 @@ func TestSubmitArgoE2E_ConcurrentRequests(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
count.Add(1)
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewEncoder(w).Encode(map[string]any{
"metadata": map[string]any{"name": "concurrent-wf"},
})
}))
@@ -184,7 +184,7 @@ func TestSubmitArgoE2E_ConcurrentRequests(t *testing.T) {
func BenchmarkSubmitArgo(b *testing.B) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`{"metadata":{"name":"bench-wf"}}`))
_, _ = w.Write([]byte(`{"metadata":{"name":"bench-wf"}}`))
}))
defer ts.Close()
@@ -193,13 +193,13 @@ func BenchmarkSubmitArgo(b *testing.B) {
b.ResetTimer()
for b.Loop() {
submitArgo(ctx, ts.Client(), ts.URL, "ai-ml", "document-ingestion", params, "bench-req")
_, _ = submitArgo(ctx, ts.Client(), ts.URL, "ai-ml", "document-ingestion", params, "bench-req")
}
}
func BenchmarkSubmitKubeflow(b *testing.B) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`{"run":{"id":"bench-run"}}`))
_, _ = w.Write([]byte(`{"run":{"id":"bench-run"}}`))
}))
defer ts.Close()
@@ -208,6 +208,6 @@ func BenchmarkSubmitKubeflow(b *testing.B) {
b.ResetTimer()
for b.Loop() {
submitKubeflow(ctx, ts.Client(), ts.URL, "rag-pipeline", params, "bench-req")
_, _ = submitKubeflow(ctx, ts.Client(), ts.URL, "rag-pipeline", params, "bench-req")
}
}