You can access the global mux as 'http.DefaultServeMux' and since a mux is
a 'http.Handler' you can add it to another mux like this:
myMux.Handle("/debug/", http.DefaultServeMux)
On Sun, Aug 21, 2016 at 10:46 AM, Amit Upadhyay wrote:
> expvar registers expvarHandler as init(), which registers
expvar registers expvarHandler as init(), which registers it to global mux.
This is convenient in general. In my app I have a non global mux, and I
have no way to register it. In case of net/http/pprof the handlers are
exported.
I have ended up copying expvarHandler() in my project.
Should I