Managing Client

I was working on writing tests using the mock.Client, but then I saw this thread discouraging global variables. How do large codebases manage the Client instance given that the Client instance is “heavy” and shouldn’t be instantiated more than once?

I’m aware this is a bit outside of the purview of Temporal, but it would be good to get community feedback on what’s worked for them. I’d also be curious on what “golang” advice the Temporal team has about it too.

I don’t see a problem with using a global variable in this case. Alternatives are either the use of some sort of IoC solution or manually pass a client instance to all the dependencies.