Skip to content
Snippets Groups Projects
Commit a83ca3c9 authored by Yawning Angel's avatar Yawning Angel
Browse files

Annotate use of deprecated `net/http/httputil` package

This is to silence some of the static analysis tools used in
development.  Despite `http.Client` and `http.Transport` being
suggested as an alternative, there is no way to accomplish current
functionality with either suggested replacement.

See: https://github.com/golang/go/issues/8285
parent 70d0e90c
Branches
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ func (s *httpProxy) Dial(network, addr string) (net.Conn, error) {
return nil, err
}
conn := new(httpConn)
conn.httpConn = httputil.NewClientConn(c, nil)
conn.httpConn = httputil.NewClientConn(c, nil) // nolint: staticcheck
conn.remoteAddr, err = net.ResolveTCPAddr(network, addr)
if err != nil {
conn.httpConn.Close()
......@@ -98,7 +98,7 @@ func (s *httpProxy) Dial(network, addr string) (net.Conn, error) {
req.Header.Set("User-Agent", "")
resp, err := conn.httpConn.Do(req)
if err != nil && err != httputil.ErrPersistEOF {
if err != nil && err != httputil.ErrPersistEOF { // nolint: staticcheck
conn.httpConn.Close()
return nil, err
}
......@@ -113,7 +113,7 @@ func (s *httpProxy) Dial(network, addr string) (net.Conn, error) {
type httpConn struct {
remoteAddr *net.TCPAddr
httpConn *httputil.ClientConn
httpConn *httputil.ClientConn // nolint: staticcheck
hijackedConn net.Conn
staleReader *bufio.Reader
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment