看了下os.Exit的代码,当code为0时可以执行某些函数?

weixin_38081679 2019-09-20 09:42:13
```
func Exit(code int) {
if code == 0 {
// Give race detector a chance to fail the program.
// Racy programs do not have the right to finish successfully.
runtime_beforeExit()
}
syscall.Exit(code)
}

func runtime_beforeExit() // implemented in runtime
```

看了源代码,当code为0时,执行runtime_beforeExit()函数,而runtime_beforeExit()函数又没有定义什么功能,我能自定义这个函数吗
...全文
56 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复

473

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧