The end of_execution in Go code (DevoxxFR 2023)
There are many ways a function, including a unit test, can end its execution in Go code. Some of these ways include return, os.Exit, runtime.Goexit.
They all interact in different ways with the defer instruction, the testing.Cleanup function, and the actual goroutine execution.
Let's see how to get our code to end its life properly, ensuring defer and Cleanup work as expected even in the face of panics, fatals, and exits.
This session was presented at the DevoxxFR 2023 conference.
Frédéric G. MARAND
May 26, 2023
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.