Files
the-way-to-go_ZH_CN/eBook/18.10.md
bohr ca72966ff1 修复一些错误 (#420)
* 修复一些错误

* 修复一些错误
2018-03-05 03:52:11 -05:00

24 lines
417 B
Markdown

# 18.10 其他
如何在程序出错时终止程序:
```go
if err != nil {
fmt.Printf(“Program stopping with error %v”, err)
os.Exit(1)
}
```
或者:
```go
if err != nil {
panic(“ERROR occurred: “ + err.Error())
}
```
## 链接
- [目录](directory.md)
- 上一节:[网络和网页应用](18.9.md)
- 下一节:[出于性能考虑的最佳实践和建议](18.11.md)