关于协程

binyuan · · 998 次点击
A complete program is created by linking a single, unimported package called the main package with all the packages it imports, transitively. The main package must have package name main and declare a function main that takes no arguments and returns no value. func main() { … } Program execution begins by initializing the main package and then invoking the function main. When that function invocation returns, the program exits. It does not wait for other (non-main) goroutines to complete.
#3
更多评论
根本没有时间执行,main goroutine 就退出了
#1
主 goroutine 要等一会儿,才能看到别的 goroutine 的输出
#2