mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-16 18:49:16 -04:00
Fix lint according to golangci-lint (#439)
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"golang.org/x/net/http2"
|
||||
|
||||
"v2ray.com/core"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/buf"
|
||||
@@ -165,7 +164,7 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp, err := http.ReadResponse(bufio.NewReader(rawConn), req)
|
||||
resp, err := http.ReadResponse(bufio.NewReader(rawConn), req) // nolint: bodyclose
|
||||
if err != nil {
|
||||
rawConn.Close()
|
||||
return nil, err
|
||||
@@ -191,7 +190,7 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
|
||||
wg.Done()
|
||||
}()
|
||||
|
||||
resp, err := h2clientConn.RoundTrip(req)
|
||||
resp, err := h2clientConn.RoundTrip(req) // nolint: bodyclose
|
||||
if err != nil {
|
||||
rawConn.Close()
|
||||
return nil, err
|
||||
|
||||
@@ -279,7 +279,7 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, wri
|
||||
|
||||
responseDone := func() error {
|
||||
responseReader := bufio.NewReaderSize(&buf.BufferedReader{Reader: link.Reader}, buf.Size)
|
||||
response, err := http.ReadResponse(responseReader, request)
|
||||
response, err := http.ReadResponse(responseReader, request) // nolint: bodyclose
|
||||
if err == nil {
|
||||
http_proto.RemoveHopByHopHeaders(response.Header)
|
||||
if response.ContentLength >= 0 {
|
||||
|
||||
Reference in New Issue
Block a user