贡献者:1
讨论数量: 0
发起讨论
只看当前版本
Go 入门指南
/
如何在程序出错时终止程序:
if err != nil {
fmt.Printf("Program stopping with error %v", err)
os.Exit(1)
}
或者:
if err != nil {
panic("ERROR occurred: " + err.Error())
}
本文章首发在 LearnKu.com 网站上。