Skip to content

Commit

Permalink
fix: avoid goroutine leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Hu-Jiang committed May 21, 2019
1 parent 8b72b2f commit 177d13f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion select/v2/racer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func ping(url string) chan bool {
ch := make(chan bool)
go func() {
http.Get(url)
ch <- true
close(ch)
}()
return ch
}
2 changes: 1 addition & 1 deletion select/v3/racer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func ping(url string) chan bool {
ch := make(chan bool)
go func() {
http.Get(url)
ch <- true
close(ch)
}()
return ch
}

0 comments on commit 177d13f

Please sign in to comment.