aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/stub/exit.go
blob: 8d859461b4f9dcab646a90dc88787b8827338beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package stub

// PanicExit is a magic panic value treated as a simulated exit.
const PanicExit = 0xdeadbeef

// HandleExit must be deferred before calling with the stub.
func HandleExit() {
	r := recover()
	if r == PanicExit {
		return
	}
	if r != nil {
		panic(r)
	}
}