MCPcopy Index your code
hub / github.com/goinaction/code / Match

Function Match

chapter2/sample/search/match.go:21–33  ·  view source on GitHub ↗

Match is launched as a goroutine for each individual feed to run searches concurrently.

(matcher Matcher, feed *Feed, searchTerm string, results chan<- *Result)

Source from the content-addressed store, hash-verified

19// Match is launched as a goroutine for each individual feed to run
20// searches concurrently.
21func 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.

Callers 1

RunFunction · 0.85

Calls 1

SearchMethod · 0.65

Tested by

no test coverage detected