MCPcopy Create free account
hub / github.com/goinaction/code / Display

Function Display

chapter2/sample/search/match.go:37–43  ·  view source on GitHub ↗

Display writes results to the console window as they are received by the individual goroutines.

(results chan *Result)

Source from the content-addressed store, hash-verified

35// Display writes results to the console window as they
36// are received by the individual goroutines.
37func Display(results chan *Result) {
38 // The channel blocks until a result is written to the channel.
39 // Once the channel is closed the for loop terminates.
40 for result := range results {
41 log.Printf("%s:\n%s\n\n", result.Field, result.Content)
42 }
43}

Callers 1

RunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected