@@ -20,8 +20,8 @@ type google struct{}
2020
2121// Search implements the Searcher interface. It performs a search
2222// against Google.
23- func (g google ) Search (searchTerm string , searchResults chan <- []Result ) {
24- log .Printf ("Google : Search : Started : searchTerm [%s]\n " , searchTerm )
23+ func (g google ) Search (term string , resChan chan <- []Result ) {
24+ log .Printf ("Google : Search : Started : search term [%s]\n " , term )
2525
2626 // Slice for the results.
2727 var results []Result
@@ -38,16 +38,16 @@ func (g google) Search(searchTerm string, searchResults chan<- []Result) {
3838 })
3939
4040 log .Printf ("Google : Search : Completed : Found[%d]\n " , len (results ))
41- searchResults <- results
41+ resChan <- results
4242}
4343
4444// Bing provides support for Bing searches.
4545type bing struct {}
4646
4747// Search implements the Searcher interface. It performs a search
4848// against Bing.
49- func (b bing ) Search (searchTerm string , searchResults chan <- []Result ) {
50- log .Printf ("Bing : Search : Started : searchTerm [%s]\n " , searchTerm )
49+ func (b bing ) Search (term string , resChan chan <- []Result ) {
50+ log .Printf ("Bing : Search : Started : search term [%s]\n " , term )
5151
5252 // Slice for the results.
5353 var results []Result
@@ -64,31 +64,31 @@ func (b bing) Search(searchTerm string, searchResults chan<- []Result) {
6464 })
6565
6666 log .Printf ("Bing : Search : Completed : Found[%d]\n " , len (results ))
67- searchResults <- results
67+ resChan <- results
6868}
6969
7070// Yahoo provides support for Yahoo searches.
7171type yahoo struct {}
7272
7373// Search implements the Searcher interface. It performs a search
7474// against Yahoo.
75- func (y yahoo ) Search (searchTerm string , searchResults chan <- []Result ) {
76- log .Printf ("Yahoo : Search : Started : searchTerm [%s]\n " , searchTerm )
75+ func (y yahoo ) Search (term string , results chan <- []Result ) {
76+ log .Printf ("Yahoo : Search : Started : search term [%s]\n " , term )
7777
7878 // Slice for the results.
79- var results []Result
79+ var r []Result
8080
8181 // Simulate an amount of time for the search.
8282 time .Sleep (time .Millisecond * time .Duration (rand .Int63n (900 )))
8383
8484 // Simulate a result for the search.
85- results = append (results , Result {
85+ r = append (r , Result {
8686 Engine : "Yahoo" ,
8787 Title : "Go Playground" ,
8888 Description : "The Go Playground is a web service that runs on golang.org's servers" ,
8989 Link : "http://play.golang.org/" ,
9090 })
9191
92- log .Printf ("Yahoo : Search : Completed : Found[%d]\n " , len (results ))
93- searchResults <- results
92+ log .Printf ("Yahoo : Search : Completed : Found[%d]\n " , len (r ))
93+ results <- r
9494}
0 commit comments