Skip to content

Commit 881012b

Browse files
Saving Changes
1 parent d69d148 commit 881012b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎chapter2/sample/search/default.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package search
33
// defaultMatcher implements the default matcher.
44
type defaultMatcher struct{}
55

6-
// init registeres the default matcher with the program.
6+
// init registers the default matcher with the program.
77
func init() {
88
var matcher *defaultMatcher
99
Register("default", matcher)

‎chapter2/sample/search/match.go‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package search
22

33
import (
4-
"fmt"
54
"log"
65
)
76

@@ -17,7 +16,7 @@ type Matcher interface {
1716
Search(feed *Feed, searchTerm string) ([]*Result, error)
1817
}
1918

20-
// Match is launched as a goroutine for each indidivudal feed to run
19+
// Match is launched as a goroutine for each individual feed to run
2120
// searches concurrently.
2221
func Match(matcher Matcher, feed *Feed, searchTerm string, results chan<- *Result) {
2322
// Perform the search against the specified matcher.
@@ -34,11 +33,11 @@ func Match(matcher Matcher, feed *Feed, searchTerm string, results chan<- *Resul
3433
}
3534

3635
// Display writes results to the console window as they
37-
// are received by the indivdual goroutines.
36+
// are received by the individual goroutines.
3837
func Display(results chan *Result) {
3938
// The channel blocks until a result is written to the channel.
4039
// Once the channel is close the for loop terminates.
4140
for result := range results {
42-
fmt.Printf("%s:\n%s\n\n", result.Field, result.Content)
41+
log.Printf("%s:\n%s\n\n", result.Field, result.Content)
4342
}
4443
}

0 commit comments

Comments
 (0)