mirror of
https://github.com/tenox7/wrp.git
synced 2025-08-07 22:25:00 +00:00
if/else to switch
This commit is contained in:
5
wrp.go
5
wrp.go
@@ -475,9 +475,10 @@ func main() {
|
|||||||
)
|
)
|
||||||
actx, acancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
actx, acancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
||||||
defer acancel()
|
defer acancel()
|
||||||
if debug {
|
switch debug {
|
||||||
|
case true:
|
||||||
ctx, cancel = chromedp.NewContext(actx, chromedp.WithDebugf(log.Printf))
|
ctx, cancel = chromedp.NewContext(actx, chromedp.WithDebugf(log.Printf))
|
||||||
} else {
|
default:
|
||||||
ctx, cancel = chromedp.NewContext(actx)
|
ctx, cancel = chromedp.NewContext(actx)
|
||||||
}
|
}
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
Reference in New Issue
Block a user