delve/_fixtures/testnextprog.go
Derek Parker 58c1f54578 Improve Next implementation
Fix bug involving detecting whether or not we have stepped into another
function when we plan on return from the function we are currently in.
2014-10-13 19:04:38 -05:00

44 lines
425 B
Go

package main
import (
"fmt"
"runtime"
"time"
)
func sleepytime() {
time.Sleep(time.Nanosecond)
}
func helloworld() {
fmt.Println("Hello, World!")
}
func testnext() {
var (
j = 1
f = 2
)
for i := 0; i <= 5; i++ {
j += j * (j ^ 3) / 100
if i == f {
fmt.Println("foo")
break
}
helloworld()
}
helloworld()
}
func main() {
runtime.LockOSThread()
for {
testnext()
fmt.Println("foo")
}
}