package port import ( "net/http" _ "net/http/pprof" "strconv" "linkfog.com/public/lib/l" ) func Start(port int) { if port != 0 { go func() { port := strconv.Itoa(port) err := http.ListenAndServe("0.0.0.0:"+port, nil) if err != nil { l.Error("pprof start", err) return } l.Info("pprof start success") }() } else { l.Debug("pprof switch is off") } }