Understanding Defer, Panic and Recover

1 · · June 8, 2013, midnight
I am building my TraceLog package and it is really important that the package logs any internal exceptions and prevents panics from shutting down the application. The TraceLog package must never be responsible for shutting down an application. I also have internal go routines that must never terminate until the application is shut down gracefully. Understanding how to use Defer and Recover in your application can be a bit tricky at first, especially if you are used to using try/catch blocks....