diff options
author | Andy Pan <panjf2000@gmail.com> | 2022-11-16 12:13:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 06:13:29 +0200 |
commit | b32a3dda13b7dcbd6e695254a9b9001434582ccf (patch) | |
tree | f6eb35a9d1b666adb95d096133a24b341696954f /tcpdialer.go | |
parent | Assert with *net.TCPConn instead of *net.TCPListener in acceptConn() for TCP ... (diff) | |
download | fasthttp-b32a3dda13b7dcbd6e695254a9b9001434582ccf.tar.gz fasthttp-b32a3dda13b7dcbd6e695254a9b9001434582ccf.tar.bz2 fasthttp-b32a3dda13b7dcbd6e695254a9b9001434582ccf.zip |
Use time.Until(deadline) instead of -time.Since(deadline) (#1434)
Diffstat (limited to 'tcpdialer.go')
-rw-r--r-- | tcpdialer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tcpdialer.go b/tcpdialer.go index 7e7cb84..5f70b77 100644 --- a/tcpdialer.go +++ b/tcpdialer.go @@ -309,7 +309,7 @@ func (d *TCPDialer) dial(addr string, dualStack bool, timeout time.Duration) (ne } func (d *TCPDialer) tryDial(network string, addr *net.TCPAddr, deadline time.Time, concurrencyCh chan struct{}) (net.Conn, error) { - timeout := -time.Since(deadline) + timeout := time.Until(deadline) if timeout <= 0 { return nil, ErrDialTimeout } |