Many frameworks have the idea of a context" for this, that holds per-request state, following your reques through the system. Functions that don't care about the context just pass it on to whatever they call.
I think Go was smart to make this concept part of the standard library, as it encouraged frameworks to adopt it as well.