3 ms·
There are other control flow options available. For example they offer the following simple example of what they call goroutines: ch := make(chan int);
by btilly 17y ago
There are other control flow options available. For example they offer the following simple example of what they call goroutines:
ch := make(chan int);
go sum(hugeArray, ch);
// ... do something else for a while
result := <-ch; // wait for, and retrieve, result
You can actually set up any complex mess you want of functions talking to other functions through channels. This gives you coroutines, threading, etc. Looking through the spec, it looks like they have anonymous functions and closures as well.
While I agree that they need to add exceptions, they do have some interesting things in there already.