content: fix example in "Go concurrency patterns" article
To quote Tim Scheuermann, who alerted me to this issue:
The text states that the channel should be buffered for the last
example to work, but the channel is already buffered. I tried to
use the codereview tool to commit the patch, but it refuses to
work on a github repository. The fix is trivial, remove the
buffer from line 2 of the example.
Thanks to Ivan Kurnosov for finding it in the first place.
Change-Id: I003f1fc0cbbb645be776eeb55d46ee3462fdf4d7
Reviewed-on: https://go-review.googlesource.com/36670
Reviewed-by: Chris Broadfoot <cbro@golang.org>
diff --git a/content/go-concurrency-patterns-timing-out-and.article b/content/go-concurrency-patterns-timing-out-and.article
index 9d60ead..fa81a2c 100644
--- a/content/go-concurrency-patterns-timing-out-and.article
+++ b/content/go-concurrency-patterns-timing-out-and.article
@@ -32,7 +32,7 @@
The function `Query` takes a slice of database connections and a `query` string. It queries each of the databases in parallel and returns the first response it receives:
func Query(conns []Conn, query string) Result {
- ch := make(chan Result, 1)
+ ch := make(chan Result)
for _, conn := range conns {
go func(c Conn) {
select {