https://pkg.go.dev/net/http#MaxBytesReader
closes the underlying reader when its Close method is called.
Is it possible to detect when the body could be implicitly closed like in the below::
res, err := client.Do(req)
if err != nil {
panic(err)
}
resBody := res.Body
if maxMediaSize > 0 {
resBody = http.MaxBytesReader(nil, res.Body, maxMediaSize)
}
defer resBody.Close()