Conversation
|
Hey, thank you for opening your first Pull Request ! |
|
|
|
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
|
|
@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 |
|
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? |
|
btw
If (2) was possible I could compile my own binary with my private linter bundled and use it without bothering you 😄 |
|
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 comment here, 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.
Please use io instead of deprecated ioutil.
| mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect | ||
| ) | ||
|
|
||
| require github.com/atzoum/reuseconn v0.1.0 // indirect |
There was a problem hiding this comment.
Should this be moved up into the existing block of indirect required modules?
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 of timakin/bodyclose with the additional goal to address the rule that is clearly described in the GoDoc of http.Response and requires that the body should be both read to completion and closed so that the underlying TCP connection can be successfully reused.