# error: http: read on closed response body

- **ID:** `go/net-http-response-body-not-closed`
- **Domain:** go
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Reading from an HTTP response body that has already been closed, often due to premature close or double close.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Always defer close after checking error** (95% success)
   ```
   resp, err := http.Get(url)
if err != nil { return err }
defer resp.Body.Close()
// read resp.Body
   ```

## Dead Ends

- **Not closing response body at all** — Leads to resource leak and eventually connection pool exhaustion. (80% fail)
