[go-nuts] Re: how to use an instance across functions in a package w/o global vars

2019-04-14 Thread itmitica
Thanks! On Sunday, April 14, 2019 at 3:28:59 AM UTC+3, al...@alrux.com wrote: > > While the expected r/w patterns will certainly influence the amount of > pain you may feel from using "global state", I would not consider it to be > the main deciding factor. > > Now, please keep in mind that this

[go-nuts] Re: how to use an instance across functions in a package w/o global vars

2019-04-13 Thread alex via golang-nuts
While the expected r/w patterns will certainly influence the amount of pain you may feel from using "global state", I would not consider it to be the main deciding factor. Now, please keep in mind that this whole topic is more a matter of coding style and trade-offs, not necessarily right-or-wr

[go-nuts] Re: how to use an instance across functions in a package w/o global vars

2019-04-13 Thread itmitica
To summarize. - w package-level var is not going to be subject of modification while being read. No problems to solve, carry on with package-level vars. - w package-level var is going to be subject of modification while being read. Problems arise, stop using package-level vars. Sol