Home »
Code Examples »
Golang Code Examples
Golang - Demonstrate how to resolve the deadlock problem using the default case? Code Example
The code for Demonstrate how to resolve the deadlock problem using the default case?
package main
import "fmt"
func main() {
c := make(chan int)
select {
case <-c:
default:
fmt.Println("Default It Is.")
}
}
/*
Output:
Default It Is
*/
Code by IncludeHelp,
on February 28, 2023 16:13