debug_routes.go 255 B

12345678910111213
  1. package debug
  2. import (
  3. "net/http"
  4. "net/http/pprof"
  5. "golang.org/x/net/context"
  6. )
  7. func handlePprof(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
  8. pprof.Handler(vars["name"]).ServeHTTP(w, r)
  9. return nil
  10. }