Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- recevingChannel := make(chan int, 1)
- sendingChannel := make(chan int, 1)
- sendingValue := 10
- select {
- case recevingValue := <- recevingChannel:
- fmt.Println(recevingValue)
- case sendingChannel <- sendingValue:
- fmt.Println("Value send")
- case <- time.After(time.Second*10):
- fmt.Println("Timeout")
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement