Skip to content

Commit

Permalink
Merge pull request gocolly#652 from lijingbo8119/master
Browse files Browse the repository at this point in the history
Fix Async ignoring its arguments
  • Loading branch information
WGH- authored Jan 28, 2022
2 parents e63893d + 669abce commit 50672b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion colly.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,11 @@ func ID(id uint32) CollectorOption {
// Async turns on asynchronous network requests.
func Async(a ...bool) CollectorOption {
return func(c *Collector) {
c.Async = true
if len(a) > 0 {
c.Async = a[0]
} else {
c.Async = true
}
}
}

Expand Down

0 comments on commit 50672b2

Please sign in to comment.