3 ms·
What happens when Go programs end? (Podcast with transcript)
- tekstar 6y agoOh, that's easy. they Stop. (I'll see myself out..)
- itake 6y agoGo! Get out of here. (I'll see myself out..)
- ransom1538 6y agohhaha. stop.
- donio 6y agoThat's not always as trivial as it sounds. One of the first Go programs I wrote back in the 1.0 days was a tool to detect hanging NFS mounts by doing a statfs on each mounted filesystem and reporting the ones where the call wouldn't return within the timeout period. I wrote the first version in Python but run into an issue where the command wouldn't exit as long as a thread that was stuck in the syscall (as expected when you have a hanging mount). I quickly rewrote it in Go as a learning exercise and was happy to see that the Go runtime would reliably exit even when a goroutine was stuck in a syscall. (Yeah I am sure there are ways to deal with it in Python too and might even work out of the box now but my naive approach didn't at the time)