Go by Example - Closing Channels
Go by Example
Go is an open source programming language designed for building simple, fast, and reliable software.
Go by Example is a hands-on introduction to Go using annotated example programs. Check out the first example or browse the full list below.
Go by Example: Closing Channels
关闭一个管道表明已经没有值会通过它来发送,这个对于向管道的接收者表达已完成的信号是有用的。
1 | package main |
1 | tashuo:golang ta_shuo$ go run closing_channel.go |