Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
Goroutines are not threads, you can use the term lightweight threads but that also could confuse the devs that does not know what they actually mean.
Os.Exit is not actually fine, the other layers may remain in memory processing and doing their stuff on different system threads. You need to send the shutdown signal to all your layers and goroutines. Easiest way is by cancelling a Context.
A few notes
Goroutines are not threads, you can use the term lightweight threads but that also could confuse the devs that does not know what they actually mean.
Os.Exit is not actually fine, the other layers may remain in memory processing and doing their stuff on different system threads. You need to send the shutdown signal to all your layers and goroutines. Easiest way is by cancelling a Context.
I appreciate the feedback, man.
I understand goroutines aren't threads on their own, and that they're more akin to scheduled tasks.
And I actually didn't know that there were lingering side-effects of os.Exit (the docs don't exactly go into that), thanks for pointing that out.