all goroutines are asleep – deadlock

Your monitorWorker never dies. When all the workers finish, it continues to wait on cs. This deadlocks because nothing else will ever send on cs and therefore wg will never reach 0. A possible fix is to have the monitor close the channel when all workers finish. If the for loop is in main, it … Read more

Does a channel return two values?

The boolean variable ok returned by a receive operator indicates whether the received value was sent on the channel (true) or is a zero value returned because the channel is closed and empty (false). The for loop terminates when some other part of the Go program closes the fromServer or the fromUser channel. In that … Read more

How to allocate an array of channels

The statement var chans [5]chan int would allocate an array of size 5, but all the channels would be nil. One way would be to use a slice literal: var chans = []chan int { make(chan int), make(chan int), make(chan int), make(chan int), make(chan int), } If you don’t want to repeat yourself, you would … Read more

resetting conda channel priorities

Change the order from ~/.condarc so that defaults the first channel as channels: – defaults – conda-forge and add this line to it channel_priority: true or run the following code in command-line conda config –set channel_priority true then again run conda update –all Good Luck Edited for new versions of conda. According to conda doc … Read more