News for hackers. Stuff that matters.
Re:My poor use of golang's defer woke me up by aktau on Monday June 23, 2014 @03:25AM (#7930647)
With defers and named return values, it is actually possible to alter the return value inside of a defer. I had to do this recently to properly log an error (to abort in the calling code). Also to do with database operations of course:

https://github.com/aktau/gomig/blob/a63d309848907a72782dd94e...

It's not the prettiest, but I needed it fixed soon. Will refactor later :).

Read about it here as well: http://blog.golang.org/defer-panic-and-recover

There are no comments on this comment yet.