阅读go源码的疑问

smart265 · · 726 次点击
感谢这位大神的解答,谢谢
#2
更多评论
Ian Taylor的回复: “The runtime is a special case in many ways, and this is among the more special parts. This loop exists to catch problems while testing new ports. If that loop is ever reached, something has gone badly wrong: the exit call should have caused the program to exit. We can't assume that panic is working. We can't really assume that anything is working. What we want to do is stop the program. Since exit failed, it's possible that a nil dereference will succeed. If that fails too, we still have to do something, so we just loop. We can't return because this is the main function that started the program; there is nothing to return to.” [链接](https://groups.google.com/forum/#!msg/golang-nuts/FnF3oZeJ7aY/sLz0G3oDAgAJ)
#1