Go by Example - Channel Synchronization
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: Channel Synchronization
我们可以使用channel来同步不同goroutine的执行。
1 | package main |
1 | $ go run channel-synchronization.go |