content: explain the example in the channels slide
There was a suggestion to simplify the example in order to
get rid of the somewhat complicated-looking code that split
the slice in half:
a[:len(a)/2]
I think that the example is actually simple enough, and that
giving the reader a bit of context up front about what the code
is accomplishing will make it seem simpler without actually
changing the code.
Fixes golang/go#13894
Change-Id: I1dfe8ec6de07bb1d74713d824e93c34835139933
Reviewed-on: https://go-review.googlesource.com/19290
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/content/concurrency.article b/content/concurrency.article
index bdde17d..5fd0fcc 100644
--- a/content/concurrency.article
+++ b/content/concurrency.article
@@ -36,6 +36,9 @@
By default, sends and receives block until the other side is ready. This allows goroutines to synchronize without explicit locks or condition variables.
+The example code sums the numbers in a slice, distributing the work between two goroutines.
+Once both goroutines have completed their computation, it calculates the final result.
+
.play concurrency/channels.go
* Buffered Channels