On Thu, Sep 13, 2018, 10:13 AM Mirko Friedenhagen <mfriedenha...@gmx.de> wrote:
> Thanks again. I think some of the use cases, especially those which > implement some kind of finally (which includes locking use case) may just > be implemented with simple functions. At least throwing exceptions is a > rare event in Golang (panicking is what I meant with rare). > > Are closures, like the one in the main method idiomatic? > I don't see why not. Also when I was using the boltdb api, I found it relies heavily on passing function closures to the view and batch functions. The signature of the function can be minimal like just returning and error, and you can capture arbitrary return values just by declaring them in the outer scope and setting them in the closure. > -- > 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. > -- 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.