On Sunday, May 24, 2020 at 3:46:54 PM UTC-4, [email protected] wrote: > > if i am not wrong, Even the main itself is a go routine, which have global > variables? >
Perhaps you should describe a bit more what you mean? People seem to be making assumptions that you meant something different that what you actually said. Assuming you are referring to the main() function, then, no it is not a goroutine, but it does run in a goroutine. However, main() doe not "have" global variables. Can you give an exmaple of what you mean by this? Global variables belong to the package, and are accessible from *any *goroutine in the package, if they are private, and from any goroutine anywhere if they are public. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/749251f0-513f-4e6b-9636-b1e596daadbb%40googlegroups.com.
