]> Cypherpunks repositories - gostls13.git/commitdiff
net/http/pprof: attach handlers using http.HandleFunc
authorTerin Stock <terinjokes@gmail.com>
Tue, 17 Oct 2017 00:34:35 +0000 (17:34 -0700)
committerTom Bergan <tombergan@google.com>
Mon, 30 Oct 2017 18:46:16 +0000 (18:46 +0000)
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 <sam@samwhited.com>
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Sam Whited <sam@samwhited.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/pprof/pprof.go

index 12c7599ab0fac8b598e2b6823ee331f1e0082fcc..21992d62da2c00cfd94c2f7ce26952ba79d0c1ee 100644 (file)
@@ -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