Comments (3)
This also occurs when using a RequestRecorder and calling .Result()
on them.
from bodyclose.
Also occurs if you ever have a function that harmlessly passes through an HTTP response,
like this:
func addHeader(resp *http.Response) *http.Response {
resp.Header.Set("foo", "bar")
return resp
}
(clearly you don't even need to return the pointer, really, but that's beside the point, this is an actual example I've seen in the wild)
from bodyclose.
This also occurs when returning a function that takes response as an argument, as in the following.
func modifyResponse() func(*http.Response) error {
return func(resp *http.Response) error {
return nil
}
}
response body must be closed (bodyclose)
proxy.go:38:40: proxy.ModifyResponse = modifyResponse()
from bodyclose.
Related Issues (20)
- Analyzer for http.Request
- False positive: if function returns io.ReadCloser
- False positive with a retry for
- False positive with body close inside separate function HOT 11
- what zbout joining revive?
- Is this project still maintained? I want to add some new features to pr
- global resp cause check panic
- SSA and generics (go1.18) HOT 5
- false positive when close is in another package HOT 1
- False Positive when http.Response from a function HOT 2
- Check both closing and consuming the response body
- Bump golang.org/x/tools to v0.7.0 (as minimum) and make new tag
- False positive when using `httptest.NewRecorder()`
- bodyclose fails unexpected HOT 1
- conflicts with errcheck?
- Close in another function's defer function is not handled correctly
- False positive when using `http.NewResponseController(rw)`
- Generated code by ent cause check panic HOT 1
- Request: tag a version
- normalize CLI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bodyclose.