delve/_fixtures/defercall.go
aarzilli 8d58262020 proc: bugfix: Next and normal calls to deferred function
When a deferred function is called directly Next and StepOut should not
step into it.

Fixes #582
2016-09-27 09:37:26 +02:00

30 lines
336 B
Go

package main
var n = 0
func sampleFunction() {
n++
}
func callAndDeferReturn() {
defer sampleFunction()
sampleFunction()
n++
}
func callAndPanic2() {
defer sampleFunction()
sampleFunction()
panic("panicking")
}
func callAndPanic() {
defer recover()
callAndPanic2()
}
func main() {
callAndDeferReturn()
callAndPanic()
}