and I'm having some trouble understanding the behavior of buffered channels.
I have a program that is supposed to concurrently spit out values from a
slice into a buffered channel, where they are supposed to be read from and
added together to form a total. The only problem is, it doesn't work.
Here is my code: http://play.golang.org/p/3gKIN_FhFm
What am I doing incorrectly here? I expected the program to create six
goroutines that fill up the channel, and then be able to read from that
channel. The answer should be 73, but I keep getting 18. Thanks for the
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.