mirror of
https://github.com/tenox7/wrp.git
synced 2024-11-25 13:30:51 +00:00
if/else to switch
This commit is contained in:
parent
fdfbe80024
commit
9cd286add8
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()
|
||||||
|
Loading…
Reference in New Issue
Block a user