Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
feat: add reuseconn linter#3464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
Hey, thank you for opening your first Pull Request ! |
CLAassistant commentedJan 7, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
ldez commentedJan 7, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements. Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
Antonboom commentedJan 11, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@atzoum, hello! Cool, but why not contribute in |
Hi@Antonboom! The reason why That being said, the reuseconn linter promotes the following pattern With respect to the possibility of extending the original cc@timakin |
Hi team, please let me know if there is anything need to be done from my side in order to move this pull request forward |
bombsimon commentedJan 23, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I was also curious why this wasn't PRed upstream to |
@timakin do you see this as a possibility, merging the 2 linters into one? |
atzoum commentedJan 26, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
btw
If (2) was possible I could compile my own binary with my private linter bundled and use it without bothering you 😄 |
ldez commentedJan 26, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
timakin commentedJan 27, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm on the same side as@bombsimon . I'll be appreciated it if@atzoum opened PR to |
Checking whether a connection can be reused entails making sure that the body is both consumed and closed. Thus, there will always be some overlapping between I will try to prepare a pull request, however based on my commenthere, it is not really straightforward to achieve this for all scenarios that @timakin if you have any better idea for implementing this please go ahead |
| import ( | ||
| "io" | ||
| "io/ioutil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please useio instead of deprecatedioutil.
| mvdan.cc/lintv0.0.0-20170908181259-adc824a0674b// indirect | ||
| ) | ||
| requiregithub.com/atzoum/reuseconnv0.1.0// indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should this be moved up into the existing block of indirect required modules?
Uh oh!
There was an error while loading.Please reload this page.
https://github.com/atzoum/reuseconn
reuseconnis a linter that checks whether the HTTP response body is consumed and closed properly in a single function, so that the underlying TCP connection can be reused.This linter is a fork oftimakin/bodyclose with the additional goal to address the rule that is clearly described in theGoDoc of http.Response and requires that the body should beboth read to completion and closed so that the underlying TCP connection can be successfully reused.