delve/_fixtures/testdeadlock.go
Alessandro Arzilli ac3b1c7a78 proc: catch fatal runtime errors (#1502)
Like we do with unrecovered panics, create a default breakpoint to
catch runtime errors that will cause the program to terminate.
Primarily intended to give users the opportunity to examine the state
of a deadlocked process.
2019-02-27 14:28:25 -08:00

13 lines
146 B
Go

package main
func main() {
ch1 := make(chan string)
ch2 := make(chan string)
go func() {
<-ch1
ch2 <- "done"
}()
<-ch2
ch1 <- "done"
}