From 01c144c410b09d8b56d40e7e9c54fface204aa29 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Mon, 16 Oct 2017 17:34:35 -0700 Subject: [PATCH] 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 --- src/net/http/pprof/pprof.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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