FAQ

On Wed, Mar 2, 2016 at 12:29 PM, Nico wrote:
I find interesting the idea of a "comma, ok" pattern for send statements. Is this something the Go authors have considered before?
This has been discussed here and on golang-dev.

TL;DR — Senders close channels, receivers check if they're closed. If
you're the sender and you send on a closed channel we panic because
you're doing it wrong; it's effectively an assertion that makes sure
you're using the pattern the way it was intended to be used.

—Sam



--
Sam Whited
pub 4096R/54083AE104EA7AD3
https://blog.samwhited.com

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

People

Translate

site design / logo © 2022 Grokbase