Skip to content

Commit 527a28f

Browse files
committed
fix: handle unchecked error return values
Wrap deferred Close() calls in anonymous functions with explicit ignore to satisfy errcheck linter.
1 parent 56b0444 commit 527a28f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

transport/http_transport.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func (t *HttpTransport) ServeHTTP(w http.ResponseWriter, r *http.Request) {
413413
}
414414

415415
func (t *HttpTransport) handleRemoveKeysRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, group transportMethods, recordError func()) {
416-
defer r.Body.Close()
416+
defer func() { _ = r.Body.Close() }()
417417

418418
b := bufferPool.Get().(*bytes.Buffer)
419419
b.Reset()
@@ -634,7 +634,7 @@ func (h *HttpClient) RemoveKeys(ctx context.Context, in *pb.RemoveKeysRequest) e
634634
return recordSpanError(span, err)
635635
}
636636

637-
defer res.Body.Close()
637+
defer func() { _ = res.Body.Close() }()
638638

639639
if res.StatusCode != http.StatusOK {
640640
msg, _ := io.ReadAll(res.Body)

0 commit comments

Comments
 (0)