delve/_fixtures/testnextprog.go
Derek Parker 3566fd5237 Improve next implementation
Improvements:
* `next`ing through a loop works correctly (when not already within a loop)
* `next`ing out of a function works correctly

Needs work:
* `next`ing in a loop can be improved when starting within a loop
2014-07-10 18:07:39 -05:00

34 lines
317 B
Go

package main
import (
"fmt"
"time"
)
func sleepytime() {
time.Sleep(time.Millisecond)
}
func helloworld() {
fmt.Println("Hello, World!")
}
func testnext() {
j := 1
for i := 0; i <= 1; i++ {
j += j * (j ^ 3) / 100
helloworld()
}
helloworld()
}
func main() {
for {
sleepytime()
testnext()
}
}