use Context to send cancelation signals to groutines
This commit is contained in:
parent
bf3225765d
commit
5048018d48
5 changed files with 42 additions and 8 deletions
|
|
@ -45,7 +45,7 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
for tweet := range twitterscraper.SearchTweets("twitter scraper data -filter:retweets", 50) {
|
||||
for tweet := range twitterscraper.SearchTweets(context.Background(), "twitter scraper data -filter:retweets", 50) {
|
||||
if tweet.Error != nil {
|
||||
panic(tweet.Error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue