I am trying to get my Go program to block forever, but nothing is working.
Here are some things I have tried:
package main
func main() {
select{}
}
and
package main
func main() {
ch := make(chan bool)
<-ch
}
and
package main
import "sync"
func main() {
var wg sync.WaitGroup
wg.Add(1)
wg.Wait()
}
Each time I get the same error: fatal error: all goroutines are asleep - deadlock!
I thought I have done this before easily. Am I able to get the go program to block forever?