syndtr/goleveldb — pull request #24 by matttproud (2013-09-05 16:10:04+00:00)
Title: Assorted Internal Cleanups

Hi @syndtr, I have taken interest in your LevelDB implementation as a replacement for the CGO-based Levigo to give me some better insight into my server without having to worry about lack of introspection into the C library land. Unfortunately I ran into some non-deterministic failures of illegal state when I deployed your library into a production environment to qualify it.

In the process of diagnosing the problems, I looked deeply into your code and discovered a few problems that I would like to fix—or at least assist with. Unfortunately the use of bare/naked returns made this diagnosis a little bit problematic when debugging how and where emitted values are set.

Since Andrew Gerrand, one of the Go authors, wrote a post espousing why naked returns should not be used most of the time (https://plus.google.com/+AndrewGerrand/posts/LmnDfgehorU), I have taken some time to remove them from the library. I found that I am able to understand the logic flow much easier now.