add codespell action (#18818)

Original work here, #18474,  refixed and updated.
This commit is contained in:
Harshavardhana
2024-01-17 23:03:17 -08:00
committed by GitHub
parent 21d60eab7c
commit dd2542e96c
125 changed files with 230 additions and 202 deletions

View File

@@ -27,11 +27,11 @@ import (
// convenient wrapper to drain any remaining data on response body.
//
// Subsequently this allows golang http RoundTripper
// to re-use the same connection for future requests.
// to reuse the same connection for future requests.
func DrainBody(respBody io.ReadCloser) {
// Callers should close resp.Body when done reading from it.
// If resp.Body is not closed, the Client's underlying RoundTripper
// (typically Transport) may not be able to re-use a persistent TCP
// (typically Transport) may not be able to reuse a persistent TCP
// connection to the server for a subsequent "keep-alive" request.
if respBody != nil {
// Drain any remaining Body and then close the connection.