Dave Cheney wrote an article about how using log.Fatal is an anti-pattern, since immediately exiting the application does not allow the application to properly clean up after itself; notably when running multiple goroutines. Instead, a call to log.Panic should be used, since this will retain the previous logging behavior, but will additionally yield a stacktrace and properly close the runtime.
This application itself spawns multiple routines via net/http, and I imagine the sqlite and the opencensus libraries might have some additional cleanup code that goes unhandled as well.
Not sure if this would ever be a real-world issue, but seems like a good pattern to enforce nonetheless.
I can PR this change, should you feel it would have a positive impact.
Dave Cheney wrote an article about how using
log.Fatal
is an anti-pattern, since immediately exiting the application does not allow the application to properly clean up after itself; notably when running multiple goroutines. Instead, a call tolog.Panic
should be used, since this will retain the previous logging behavior, but will additionally yield a stacktrace and properly close the runtime.This application itself spawns multiple routines via
net/http
, and I imagine the sqlite and the opencensus libraries might have some additional cleanup code that goes unhandled as well.Not sure if this would ever be a real-world issue, but seems like a good pattern to enforce nonetheless.
I can PR this change, should you feel it would have a positive impact.