
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.
13 lines
146 B
Go
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"
|
|
}
|