[go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-23 Thread adithyasashasai
Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!.. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gr

[go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-24 Thread saied
Variable scope is a textual (special if you like) concept. Go routines are a temporal concept. Does it make sense to think about a global variable in this way? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-23 Thread robert engels
Use a package exported (public) variable. > On May 23, 2020, at 2:34 PM, adithyasasha...@gmail.com wrote: > > Is there a way to create a global variable inside go routine stack? so that i > can access any time, without passing around between methods/functions. Crazy > thought !!!.. > > -- > Y

Re: [go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-23 Thread Sam Whited
You are describing a thread-local variable (or a goroutine local variable, I suppose). The Go authors didn't feel this was an appropriate feature for Go and it is not supported. You may find some third party libraries that do this by parsing stack traces and using them to index into maps or simila

Re: [go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-23 Thread Robert Engels
Ignore, didn’t see the stack statement. > On May 23, 2020, at 4:46 PM, robert engels wrote: > > Use a package exported (public) variable. > >> On May 23, 2020, at 2:34 PM, adithyasasha...@gmail.com wrote: >> >> Is there a way to create a global variable inside go routine stack? so that >> i

Re: [go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-29 Thread robert engels
As the issue concludes - it was decided against. So, nothing to see here folks. > On May 29, 2020, at 10:04 PM, adithyasasha...@gmail.com wrote: > > https://github.com/golang/go/issues/21355 > , this is the issue i am reffering > to. > > On Monday, Ma

Re: [go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-29 Thread robert engels
Your use of the word “Global” in this sense is very non-standard. What the issue refers to is TLS/GLS which is scoped by the Go routine - regular exported variables are “global”. > On May 29, 2020, at 10:07 PM, adithyasasha...@gmail.com wrote: > > Thanx. This i thought but i want context as "Gl