In our web application, we have used channels to perform some parallel operation.
case 1: When I use the channel in global scope , during the second request it hungs up at the place before writing the channel 1.
case 2: when I use inside the method and pass the channels to the go routine, it works properly.
https://play.golang.org/p/3nNl9RK0Tbk (case 2 code)
My question is that if it thinks during the second request channels are closed in case 1 , it should throw panic saying channels are closed and cannot write to closed channels. But it is not throwing panic and just hung there. Kindly let me know if you need any details.