Awesome, thanks so much for the help here! Learned a lot from the input and
code examples. :)

Much appreciated!

On Thu, 2 Sep 2021, 15:49 Bryan C. Mills, <bcmi...@google.com> wrote:

> On Wed, Sep 1, 2021 at 5:55 PM <sanyia.said...@gmail.com> wrote:
>
>> Thanks Bryan, especially for the code example.
>>
>>
>> Would using a sync.WaitGroup in place of the `done` channel in your
>> example be overkill? Just exploring what’s possible here for my own
>> education.
>>
>
> Using a `sync.WaitGroup` in place of the `done` channel would be correct,
> but perhaps less useful: it's about the same amount of code, but you can
> `select` on the channel but not on the WaitGroup.
>
> (That said, a WaitGroup *would* avoid a pointer indirection: channels are
> reference types, whereas WaitGroups are value types. That difference is the
> motivation behind my proposal in https://golang.org/issue/28366.)
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAChppvka_ud8h%2BUba0z7qP2ANescD3QTh5HB-LJu4i1fydiLKQ%40mail.gmail.com.

Reply via email to