Skip to content

Commit 39033e4

Browse files
Declared channels in functions as write only
1 parent 17aee29 commit 39033e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/chapter2/search/feed/feed.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type (
1818
)
1919

2020
// Search pulls down each feed looking for the search term.
21-
func Search(matcher Matcher, searchTerm string, results chan Result) {
21+
func Search(matcher Matcher, searchTerm string, results chan<- Result) {
2222
// Search the data for the search term.
2323
searchResults, err := matcher.Match(searchTerm)
2424
if err != nil {
@@ -33,7 +33,7 @@ func Search(matcher Matcher, searchTerm string, results chan Result) {
3333
}
3434

3535
// Display writes results to the console window.
36-
func Display() chan Result {
36+
func Display() chan<- Result {
3737
// Create a channel to receive the results on.
3838
result := make(chan Result)
3939

0 commit comments

Comments
 (0)