Henrik, Here I've tried to put a sample (other than the built-in log package) for cases that global stuff makes things more clear and pragmatic (IMHO).
On Thursday, August 17, 2017 at 11:44:09 AM UTC+4:30, Henrik Johansson wrote: > > Sorry to but in but what happened to the whole logging initiative that was > on going? > Did I miss something about that? It seems very related to this. > > tors 17 aug. 2017 kl 09:10 skrev dc0d <kaveh.sh...@gmail.com <javascript:> > >: > >> As they say global variables/things are bad. But I even use a global >> Context and WaitGroup for signaling the termination of the whole program. >> On exit the context will get canceled and the program waits for the >> WaitGroup with a timeout. I would like to have those inside another >> built-in package. >> >> There are many cases (/packages) that one can not pass the Context (and >> the WaitGroup) to each and every goroutine. It's possible to define a >> struct and use it as a closure for those functions(now methods). But one >> has to rewrite the whole interface to a package. >> >> Forcing the function signature *everywhere* is not a practice/pattern >> anymore (hint: if it was not forced to be *everywhere*, it was a >> pattern). It's something else. >> >> -- >> 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...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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. For more options, visit https://groups.google.com/d/optout.