From 06bcafdc246846a25d2a46135607fd573a5a1ad7 Mon Sep 17 00:00:00 2001 From: Maxim Fominykh Date: Sat, 11 Jan 2020 05:26:35 +0500 Subject: [PATCH] Duration order consistency when multiplying number by time unit --- pipe.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipe.go b/pipe.go index 83658d7..ff96dff 100644 --- a/pipe.go +++ b/pipe.go @@ -198,7 +198,7 @@ func tryDialPipe(ctx context.Context, path *string, access uint32) (syscall.Hand } // Wait 10 msec and try again. This is a rather simplistic // view, as we always try each 10 milliseconds. - time.Sleep(time.Millisecond * 10) + time.Sleep(10 * time.Millisecond) } } } @@ -211,7 +211,7 @@ func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { if timeout != nil { absTimeout = time.Now().Add(*timeout) } else { - absTimeout = time.Now().Add(time.Second * 2) + absTimeout = time.Now().Add(2 * time.Second) } ctx, _ := context.WithDeadline(context.Background(), absTimeout) conn, err := DialPipeContext(ctx, path)