1
0
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:
Loyalsoldier
2020-11-22 05:05:01 +08:00
committed by GitHub
parent f41286a0c7
commit b68f943c78
39 changed files with 96 additions and 137 deletions

View File

@@ -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

View File

@@ -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 {