channel has no limit on capacity v/s it works when the channel has a limit on capacity?
https://play.golang.org/p/4-QI5zE7F7g
v/s
https://play.golang.org/p/DYOIPn6XHdx
http://play.golang.org
check now
you're making the main goroutine write to an unbuffered channel which makes it wait for another goroutine to read from it. However, there's no other goroutine reading so you end up with a dead lock
thanks! better 🙂
Обсуждают сегодня