refactor: replace Dial by DialContext. (#585)

This commit is contained in:
Ludovic Fernandez 2018-07-01 00:55:57 +02:00 committed by GitHub
parent 54422ab226
commit 94e14328ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,10 +26,10 @@ var (
HTTPClient = http.Client{ HTTPClient = http.Client{
Transport: &http.Transport{ Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment, Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{ DialContext: (&net.Dialer{
Timeout: 30 * time.Second, Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second, KeepAlive: 30 * time.Second,
}).Dial, }).DialContext,
TLSHandshakeTimeout: 15 * time.Second, TLSHandshakeTimeout: 15 * time.Second,
ResponseHeaderTimeout: 15 * time.Second, ResponseHeaderTimeout: 15 * time.Second,
ExpectContinueTimeout: 1 * time.Second, ExpectContinueTimeout: 1 * time.Second,