3 ms·
The author does call this out: > While it certainly looks like an interesting technique, for our particular use case this approach seems like an overkill. In f
by bowmessage 8y ago
The author does call this out:
> While it certainly looks like an interesting technique, for our particular use case this approach seems like an overkill. In fact, overuse of channels is one of the common gotchas for Go beginners. Quoting from the Go Wiki entry:
> > Most locking issues can be solved using either channels or traditional locks.
> So which should you use?
> Use whichever is most expressive and/or most simple.
It then goes on to suggest that mutexes are preferable for protecting shared state. I tend to agree, since a mutex feels more natural here.