-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
Now, sending values to closed channels will panic, and sending values to channels is viewed as non-blocking operation. The two facts combined limits the possibilities of using the select mechanics.
So I proposal a special syntax for sending values to channels:
aChannel <-| value
When using this syntax to send values to closed channels, it will not panic but block the current goroutine. In other words, sending values to closed channels with the new syntax will be viewed as a blocking operation. This will create more possibilities to use the select mechanics.
Maybe adding another one would be better
aChannel <-? value
When using this syntax to send values to closed channels, it will neither panic nor block the current goroutine. In other words, sending values to closed channels with this new syntax is a no-op.