func newHTTPClient() *http.Client { return &http.Client{ Transport: httputil.NewAuthTransport( &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: *dialTimeout, KeepAlive: *requestTimeout / 2, }).Dial, ResponseHeaderTimeout: *requestTimeout / 2, TLSHandshakeTimeout: *requestTimeout / 2, }, ), Timeout: *requestTimeout, } }
func newHTTPClient() *http.Client { t := newCacheTransport() t.Transport = &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: *dialTimeout, KeepAlive: *requestTimeout / 2, }).Dial, ResponseHeaderTimeout: *requestTimeout / 2, TLSHandshakeTimeout: *requestTimeout / 2, } return &http.Client{ // Wrap the cached transport with GitHub authentication. Transport: httputil.NewAuthTransport(t), Timeout: *requestTimeout, } }