I am new to golang and currently trying to build a multi-tenant application. In my application each tenants have their own database. My requirement is that I need to switch database connection per tenant request, how can this be accomplished in golang. I prefer postgresql for this project.
I can have a map of database connection to tenant, but not sure if this is a good practice.
Your help and suggestion is highly appreciated