From 2090fbac76b196987833e169f3e6d89ef340480c Mon Sep 17 00:00:00 2001 From: stefin <112696367+stefin9898@users.noreply.github.com> Date: Wed, 17 May 2023 19:43:41 +0530 Subject: [PATCH] Added mux handler for pprof debug endpoint --- src/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.go b/src/main.go index 38044f30..6efbad3b 100644 --- a/src/main.go +++ b/src/main.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "math/rand" "net" "os" @@ -44,7 +43,9 @@ func init() { // Server for pprof go func() { log.Info().Msgf("pprof enabled on :6060\n") - fmt.Println(http.ListenAndServe(":6060", nil)) + r := http.NewServeMux() + r.Handle("/debug/", http.DefaultServeMux) + http.ListenAndServe(":6060", r) }() }