2 ms·
I think this is an unneccesary absolute take. Panic is rarely used for error handling and nobody is advocating for its use in practice. I wouldn't use os.Exit()
by Cthulhu_ 2y ago
I think this is an unneccesary absolute take. Panic is rarely used for error handling and nobody is advocating for its use in practice. I wouldn't use os.Exit() in deeper layers of code myself, it's better to have OS level startup / shutdown in a single / central location so that the other layers of a nontrivial application don't need to be aware of it. Having a recover block somewhere allows for graceful shutdown and logging, whereas using os.Exit() in random places would require you to write a utility function or repeat the shutdown / logging procedure.