Closed iurydias closed 2 years ago
Hi @iurydias,
Yes, you are right! Using log.Fatal
, the defer
isn't executed. In this case, using log.Panic
is better because all the defer
functions are performed as expected. I will change this in the main
function.
Thanks
Hi @eminetto,
It is correct using log.Fatal on your main? Since it calls os.Exit and it will never run your defer functions (gracefully closing your database connection).