Пример #1
0
func illegalOffset() {
	defer func() {
		if r := recover(); r != nil {
			print("Recovered in illegalOffset")
		}
	}()
	hopwatch.CallerOffset(-1).Break()
}
Пример #2
0
func debug(vars ...interface{}) *hopwatch.Watchpoint {

	// create a watchpoint and compensate for extra stack frame
	watchPoint := hopwatch.CallerOffset(2 + 1)

	watchPoint.Dump(vars...)

	// revert compensation for calls on the return value
	watchPoint.CallerOffset(2)

	return watchPoint
}
Пример #3
0
func indirectBreak() {
	hopwatch.CallerOffset(3).Break()
}
Пример #4
0
func indirectDisplay(args ...interface{}) {
	hopwatch.CallerOffset(2).Display(args...)
}
Пример #5
0
func illegalOffset() {
	hopwatch.CallerOffset(-1).Break()
}
Пример #6
0
func Display(args ...interface{}) {
	hopwatch.CallerOffset(3).Display(args...)
}
Пример #7
0
func Debug(args ...interface{}) {
	hopwatch.CallerOffset(3).Display(args...).Break()
}