From a83ca3c9fe7a3adbbcd9a376fb5de988db185440 Mon Sep 17 00:00:00 2001
From: Yawning Angel <yawning@schwanenlied.me>
Date: Sat, 19 Jan 2019 11:19:02 +0000
Subject: [PATCH] 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
---
 obfs4proxy/proxy_http.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/obfs4proxy/proxy_http.go b/obfs4proxy/proxy_http.go
index c108943..35ec737 100644
--- a/obfs4proxy/proxy_http.go
+++ b/obfs4proxy/proxy_http.go
@@ -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
 }
-- 
GitLab