From 0468c97a7e5a3c468037055720b5952b02e76288 Mon Sep 17 00:00:00 2001 From: Valery Krivchikov Date: Sat, 15 Sep 2018 14:27:29 +0300 Subject: [PATCH] Fix undefined cancel --- conn_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conn_test.go b/conn_test.go index 83df2c8d..2e4ea7b2 100644 --- a/conn_test.go +++ b/conn_test.go @@ -1553,7 +1553,7 @@ func TestListenNotify(t *testing.T) { } // when timeout occurs - ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond) + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) defer cancel() notification, err = listener.WaitForNotification(ctx) if err != context.DeadlineExceeded { @@ -1711,7 +1711,7 @@ func TestListenNotifySelfNotification(t *testing.T) { t.Fatalf("Unexpected error on Query: %v", rows.Err()) } - ctx, cancel = context.WithTimeout(context.Background(), time.Second) + ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() notification, err = conn.WaitForNotification(ctx) if err != nil {