コード例 #1
0
ファイル: testing.go プロジェクト: Zuozuohao/go
// startAlarm starts an alarm if requested.
func startAlarm() {
	if *timeout > 0 {
		timer = time.AfterFunc(*timeout, func() {
			debug.SetTraceback("all")
			panic(fmt.Sprintf("test timed out after %v", *timeout))
		})
	}
}
コード例 #2
0
ファイル: loudpanic.go プロジェクト: Raskal8/go-ethereum
// LoudPanic panics in a way that gets all goroutine stacks printed on stderr.
func LoudPanic(x interface{}) {
	debug.SetTraceback("all")
	panic(x)
}