> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# go-http-response-body-not-closed

> A Go function reads the contents of a locally owned HTTP response without closing its body.

## What it flags

The rule matches a local net/http Get or Post with a checked error when the next return reads the entire body through io.ReadAll. Close the body once the request succeeds. Ownership transfers and other control-flow paths are outside the rule's initial coverage.

The rule recognizes a deferred closure registered earlier in the same block when the closure checks and closes the response variable declared in that block.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.