execution of a go program

88 views
Skip to first unread message

Adithyan Unni

unread,
Aug 22, 2024, 9:50:37 AMAug 22
to golang-nuts
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

Brian Candler

unread,
Aug 22, 2024, 11:24:34 AMAug 22
to golang-nuts
It's easy enough to demonstrate:

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.
Reply all
Reply to author
Forward
0 new messages