AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
[TOC] ## code <details> <summary>pprof.go</summary> ``` package utils import ( "log" "net/http" "net/http/pprof" ) func init() { http.DefaultServeMux = http.NewServeMux() } func Handle(mux *http.ServeMux) { mux.HandleFunc("/debug/pprof/", pprof.Index) mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) mux.HandleFunc("/debug/pprof/profile", pprof.Profile) mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) mux.HandleFunc("/debug/pprof/trace", pprof.Trace) } func NewServeMux() *http.ServeMux { mux := http.NewServeMux() Handle(mux) return mux } func NewServer(addr string) *http.Server { return &http.Server{ Addr: addr, Handler: NewServeMux(), } } func ListenAndServe(addr string) error { return NewServer(addr).ListenAndServe() } // 调用 RunPprof(":6061") func RunPprof(addr string) { go func() { log.Fatal(ListenAndServe(addr)) }() } ``` </details> <br/>