Skip to content

Commit d6ccdad

Browse files
Using a buffered channel for sending and receiving results.
1 parent b08184c commit d6ccdad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎chapter2/sample/search/search.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ func Run(searchTerm string) {
2626
log.Fatal(err)
2727
}
2828

29-
// Create a channel to receive match results to display.
30-
results := make(chan *Result)
29+
// Create a buffered channel to receive match results to display.
30+
results := make(chan *Result, len(feeds))
3131

3232
// Setup a wait group so we can process all the feeds.
3333
var waitGroup sync.WaitGroup

0 commit comments

Comments
 (0)