Display writes results to the console window as they are received by the individual goroutines.
(results chan *Result)
| 35 | // Display writes results to the console window as they |
| 36 | // are received by the individual goroutines. |
| 37 | func 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 | } |