We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
要注意的是,在main.main函数执行之前所有代码都运行在同一个goroutine,也就是程序的主系统线程中。因此,如果某个init函数内部用go关键字启动了新的goroutine的话,新的goroutine只有在进入main.main函数之后才可能被执行到。
执行这段代码 可以发现新的goroutine在init函数结束之前,也就是main函数开始之前就执行了,与文中所说不符。
The text was updated successfully, but these errors were encountered:
亲测, 不符 (go version go1.17.3 darwin/amd64)
Sorry, something went wrong.
chai2010
Successfully merging a pull request may close this issue.
执行这段代码 可以发现新的goroutine在init函数结束之前,也就是main函数开始之前就执行了,与文中所说不符。
The text was updated successfully, but these errors were encountered: