mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2024-12-25 14:28:58 +00:00
commit
41b5d08c72
@ -96,8 +96,9 @@ src/gopl.io/ch5/defer1/defer.go:10
|
||||
|
||||
为了方便诊断问题,runtime包允许程序员输出堆栈信息。在下面的例子中,我们通过在main函数中延迟调用printStack输出堆栈信息。
|
||||
|
||||
<u><i>gopl.io/ch5/defer2</i></u>
|
||||
|
||||
```Go
|
||||
gopl.io/ch5/defer2
|
||||
func main() {
|
||||
defer printStack()
|
||||
f(3)
|
||||
|
Loading…
Reference in New Issue
Block a user