FAQ
The program exits as soon as main completes, i.e. after sending 3 and closing the channel. The program exits before the goroutine has a chance to read the 3.

You could add an:

  fmt.Println("exiting main")

at the end of main to confirm this.

--
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 golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 5 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 7, '15 at 10:03a
activeMar 7, '15 at 7:13p
posts5
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase