Skip to content

Commit

Permalink
Added mux handler for pprof debug endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
stefin9898 authored and wazir-ahmed committed May 17, 2023
1 parent 268c443 commit 5f0ee5a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"math/rand"
"net"
"os"
Expand Down Expand Up @@ -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)
}()
}

Expand Down

0 comments on commit 5f0ee5a

Please sign in to comment.