From: Terin Stock Date: Tue, 17 Oct 2017 00:34:35 +0000 (-0700) Subject: net/http/pprof: attach handlers using http.HandleFunc X-Git-Tag: go1.10beta1~534 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=01c144c410b09d8b56d40e7e9c54fface204aa29;p=gostls13.git net/http/pprof: attach handlers using http.HandleFunc Simplify how pprof attaches the handlers to the DefaultMux by using http.HandleFunc instead of manually wrapping the handlers in a http.HandlerFunc. Change-Id: I65db262ebb2e29e4b6f30df9d2688f5daf782c29 Reviewed-on: https://go-review.googlesource.com/71251 Reviewed-by: Sam Whited Reviewed-by: Tom Bergan Run-TryBot: Sam Whited TryBot-Result: Gobot Gobot --- diff --git a/src/net/http/pprof/pprof.go b/src/net/http/pprof/pprof.go index 12c7599ab0..21992d62da 100644 --- a/src/net/http/pprof/pprof.go +++ b/src/net/http/pprof/pprof.go @@ -69,11 +69,11 @@ import ( ) func init() { - 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)) - http.Handle("/debug/pprof/trace", http.HandlerFunc(Trace)) + http.HandleFunc("/debug/pprof/", Index) + http.HandleFunc("/debug/pprof/cmdline", Cmdline) + http.HandleFunc("/debug/pprof/profile", Profile) + http.HandleFunc("/debug/pprof/symbol", Symbol) + http.HandleFunc("/debug/pprof/trace", Trace) } // Cmdline responds with the running program's