under-the-hood icon indicating copy to clipboard operation
under-the-hood copied to clipboard

ch02life:main.md init 部分相关内容已过时

Open cnbailian opened this issue 4 years ago • 2 comments

动机

init 相关内容已过时

需求说明

runtime.main 中关于 init 调用部分有更新,包括编译器部分。 相关 commit:https://github.com/golang/go/commit/d949d0b9252be1fffeadd65183a6bab3acf3de7a 本人水平有限,勉强能看懂一些,但还远远达不到能提 PR 修改此处。期待相关更新。

ps.这个项目能重启真是太好了 🎉

cnbailian avatar Jan 07 '21 03:01 cnbailian

你好,感谢提醒。确实这部分内容已经过时,init 已经不再是生成代码的方式来,运行时会通过直接调用编译器准备好的 main_inittask 入口地址来直接调用这些初始化函数,这个变化是在 1.13 完成的。

本书今年会陆续对内容进行大量修订和重写,欢迎点击 Watch 保持关注。

changkun avatar Jan 07 '21 07:01 changkun

期待

hoset avatar Jan 07 '21 08:01 hoset