diff options
author | Andrew Gerrand <adg@golang.org> | 2017-02-09 12:41:51 +1100 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2017-02-09 01:51:22 +0000 |
commit | 0f0b22bf6b51c0cfe8f13bd5815143fa4e75b1b8 (patch) | |
tree | 97b666778c52edb24e9baea589263e8dfc352405 /content | |
parent | dd7087de69d9cc6e499914de02277f4e4de499b5 (diff) |
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>
Diffstat (limited to 'content')
-rw-r--r-- | content/go-concurrency-patterns-timing-out-and.article | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ Let's look at another variation of this pattern. In this example we have a progr 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 { |