One thing I find frustrating about the net/http/pprof package is its init method, which does:
http.Handle("/debug/pprof/", http.HandlerFunc(Index))
http.Handle("/debug/pprof/cmdline", http.HandlerFunc(Cmdline))
http.Handle("/debug/pprof/profile", http.HandlerFunc(Profile))
http.Handle("/debug/pprof/symbol", http.HandlerFunc(Symbol))
In my particular case, I wanted all normal application traffic to be handled by my 8080 handler, and the /debug/* traffic handled by another listener on port 6060. Even if I explicitly link the above handler functions into my port 6060 ServeMux, because of the init() method it still registers across all of my handlers. I.e. port 8080 and 6060 both respond to, for example, /debug/pprof/cmdline.