Match is launched as a goroutine for each individual feed to run searches concurrently.
(matcher Matcher, feed *Feed, searchTerm string, results chan<- *Result)
| 19 | // Match is launched as a goroutine for each individual feed to run |
| 20 | // searches concurrently. |
| 21 | func Match(matcher Matcher, feed *Feed, searchTerm string, results chan<- *Result) { |
| 22 | // Perform the search against the specified matcher. |
| 23 | searchResults, err := matcher.Search(feed, searchTerm) |
| 24 | if err != nil { |
| 25 | log.Println(err) |
| 26 | return |
| 27 | } |
| 28 | |
| 29 | // Write the results to the channel. |
| 30 | for _, result := range searchResults { |
| 31 | results <- result |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // Display writes results to the console window as they |
| 36 | // are received by the individual goroutines. |