delve/_fixtures/livetestprog.go

27 lines
245 B
Go
Raw Normal View History

package main
import (
"fmt"
"os"
2014-10-07 22:02:04 +00:00
"runtime"
)
2014-05-27 15:44:29 +00:00
func printPid(pid int) {
fmt.Println(pid)
}
func sayhi() {
fmt.Println("hi")
}
func main() {
2014-10-07 22:02:04 +00:00
runtime.LockOSThread()
pid := os.Getpid()
2014-05-27 15:44:29 +00:00
printPid(pid)
for {
2014-05-27 15:44:29 +00:00
printPid(pid)
sayhi()
}
}