Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
leoromanovsky committed Apr 16, 2024
1 parent f86c054 commit 4330687
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eppoclient/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ func (hc *httpClient) get(resource string) (string, error) {

resp, err := hc.client.Do(req)
if err != nil {
// from https://golang.org/pkg/net/http/#Client.Do
//
// An error is returned if caused by client policy (such as
// CheckRedirect), or failure to speak HTTP (such as a network
// connectivity problem). A non-2xx status code doesn't cause an
// error.
//
// We should almost never expect to see this condition be executed.
return "", err // Return an empty string and the error
}
defer resp.Body.Close() // Ensure the response body is closed
Expand Down

0 comments on commit 4330687

Please sign in to comment.