go fmt
This commit is contained in:
parent
d09e496387
commit
f3794ba244
14
search.go
14
search.go
@ -27,16 +27,16 @@ func fakeSearch(kind string) Search {
|
||||
|
||||
func Google(query string) (results []Result) {
|
||||
c := make(chan Result)
|
||||
go func(){c <- Web(query)}()
|
||||
go func(){c <- Image(query)}()
|
||||
go func(){c <- Video(query)}()
|
||||
go func() { c <- Web(query) }()
|
||||
go func() { c <- Image(query) }()
|
||||
go func() { c <- Video(query) }()
|
||||
|
||||
timeout := time.After(80 * time.Millisecond)
|
||||
for i :=0; i < 3; i++ {
|
||||
select{
|
||||
case result := <- c:
|
||||
for i := 0; i < 3; i++ {
|
||||
select {
|
||||
case result := <-c:
|
||||
results = append(results, result)
|
||||
case <- timeout:
|
||||
case <-timeout:
|
||||
fmt.Println("timed out!!")
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user