It's easy enough to demonstrate: https://go.dev/play/p/dvTJL5_UJrs
You have a process with threads where goroutines run. When that process dies, all goroutines die too. They cannot live beyond, or independently from, the main process. On Thursday 22 August 2024 at 14:50:37 UTC+1 Adithyan Unni wrote: > i have a doubt i have a go routine in my code if my program ends still the > go routine will work right . > the doubt is that when my program ends is it the main function or the > soure code as a whole ends > > the source code is converted to binary -- then we get a execution file > then we do the code execution right as a whole , but when earlier case if > program execute and exited the go routine should also exit right -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/010ec711-8fe1-4bfe-8148-3c5d75a788f0n%40googlegroups.com.