should use time.Since instead of time.Now().Sub

This commit is contained in:
Wang Guoliang
2018-02-11 21:17:00 +08:00
committed by Guoliang Wang
parent a5c3c8d16c
commit 89669283fe
25 changed files with 39 additions and 38 deletions

View File

@@ -399,7 +399,7 @@ func (l *SSHTunnelList) Dial(net, addr string) (net.Conn, error) {
id := mathrand.Int63() // So you can match begins/ends in the log.
glog.Infof("[%x: %v] Dialing...", id, addr)
defer func() {
glog.Infof("[%x: %v] Dialed in %v.", id, addr, time.Now().Sub(start))
glog.Infof("[%x: %v] Dialed in %v.", id, addr, time.Since(start))
}()
tunnel, err := l.pickTunnel(strings.Split(addr, ":")[0])
if err != nil {