Toy syntax to address fork-join patterns: go somefunc() (foo int64 /* must match return of somefunc()) { // this block executed when the goroutine for somefunc() terminates; return values of somefunc are values of signature // as a defer-equivalent so that the defer() for panic recovery is in place if r := recover(); r != nil {} ... }
which is almost exactly equivalent to writing: go func() { defer func() { if r := recover(); r != nil {... // some logic here; but actually executes ater somefunc()} } x, y, ...:= somefunc() // this block executed somefunc() terminates; return values of somefunc are locals; logic // is split into the function above and here } ... other than the inverted structure of the latter, the real issue is it's hard to write a nice-to-use join-er generator as a package function since it needs to take a lot of different signatures. -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.