mirror of
https://github.com/golang/go
synced 2024-11-23 16:20:04 -07:00
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 <sam@samwhited.com> Reviewed-by: Tom Bergan <tombergan@google.com> Run-TryBot: Sam Whited <sam@samwhited.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
877387e38a
commit
01c144c410
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user