all: use time.Until where applicable
Updates #14595 Change-Id: Idf60b3004c7a0ebb59dd48389ab62c854069e09f Reviewed-on: https://go-review.googlesource.com/28073 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
f513433c3e
commit
0d6f47c2a7
2
tls.go
2
tls.go
@ -102,7 +102,7 @@ func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*
|
|||||||
timeout := dialer.Timeout
|
timeout := dialer.Timeout
|
||||||
|
|
||||||
if !dialer.Deadline.IsZero() {
|
if !dialer.Deadline.IsZero() {
|
||||||
deadlineTimeout := dialer.Deadline.Sub(time.Now())
|
deadlineTimeout := time.Until(dialer.Deadline)
|
||||||
if timeout == 0 || deadlineTimeout < timeout {
|
if timeout == 0 || deadlineTimeout < timeout {
|
||||||
timeout = deadlineTimeout
|
timeout = deadlineTimeout
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user