[go-nuts] Re: beginner question about chanels

2018-05-04 Thread k1attila1
Thank you Sir now i understand the difference 2018. május 4., péntek 15:21:49 UTC+2 időpontban k1at...@gmail.com a következőt írta: > > Hi > > i dont' understn what is the difference between : > > ch := make(chan bool,1) vs. ch := make(chan bool) > > this sample works well : > > packag

[go-nuts] Re: beginner question about chanels

2018-05-04 Thread Ankit Gupta
ch := make(chan bool) means you want to have an unbufferred channel. Send and Receive are block operations. In other words, send will block unless there is a receive operation, which is the case in your code. All calls to increment are blocked at ch <- true. When you change it to ch := make(cha