delve/_fixtures/testnextprog.go

44 lines
430 B
Go
Raw Normal View History

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