Closed robgssp closed 7 years ago
It would be nice if you could write code of the form var x = go DoWork(y, z). This would be the more concise equivalent to
var x = go DoWork(y, z)
var x = make(chan T) go func(y1, z1) { x <- DoWork(y1, z1) } (y, z)
This eliminates some of the boilerplate of spinning off a background computation when you actually do care about its return value.
On second thought this is probably a bad idea since it would silently drop panics. Promises as a library feature would be better (and now that generics are available, implementable).
It would be nice if you could write code of the form
var x = go DoWork(y, z)
. This would be the more concise equivalent toThis eliminates some of the boilerplate of spinning off a background computation when you actually do care about its return value.