On Sat, May 4, 2019 at 11:22 PM Louki Sumirniy <louki.sumirniy.stal...@gmail.com> wrote:
> The first thing you will notice is that it is a LOT shorter. It fails a simple test: https://play.golang.org/p/v3OSWxTpTQY The original is ok: https://play.golang.org/p/OhB8qZl2QLQ Another problem is starting a new goroutine per Waitgroup. Not only that consumes more resources, but it is a way how to leak the behind-the-scenes goroutine on any unexpected/incorrect usage pattern. The original is immune to this problem. Also, please note that a select statement with one case only and no default case can be replaced by that single case operation itself. And closing the channel on the receiving side is not something that should usually be done. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.