From 1a54253acd3512cd0bb199af7582b8d60c104ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 17 Apr 2019 13:29:11 +0900 Subject: [PATCH] make vet happy with TestBrowserQuit It's right that we were leaking a context here, resulting in a timer not being stopped once the test finished. --- chromedp_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chromedp_test.go b/chromedp_test.go index a3d7d08..abef5e1 100644 --- a/chromedp_test.go +++ b/chromedp_test.go @@ -158,7 +158,8 @@ func TestBrowserQuit(t *testing.T) { // Run should error with something other than "deadline exceeded" in // much less than 5s. - ctx2, _ := context.WithTimeout(ctx, 5*time.Second) + ctx2, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() switch err := Run(ctx2, Navigate(s.URL)); err { case nil: t.Fatal("did not expect a nil error")