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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to