From 9cd286add8f6e5f88ce28959b1be19b08a305768 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Sun, 6 Nov 2022 01:20:18 -0800 Subject: [PATCH] if/else to switch --- wrp.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wrp.go b/wrp.go index 8b58895..6301c50 100644 --- a/wrp.go +++ b/wrp.go @@ -475,9 +475,10 @@ func main() { ) actx, acancel := chromedp.NewExecAllocator(context.Background(), opts...) defer acancel() - if debug { + switch debug { + case true: ctx, cancel = chromedp.NewContext(actx, chromedp.WithDebugf(log.Printf)) - } else { + default: ctx, cancel = chromedp.NewContext(actx) } defer cancel()