Skip to content

Instantly share code, notes, and snippets.

@fjrti
Created January 31, 2024 16:27
Show Gist options
  • Save fjrti/6a438b7820876b696ec5e71715ab536e to your computer and use it in GitHub Desktop.
Save fjrti/6a438b7820876b696ec5e71715ab536e to your computer and use it in GitHub Desktop.
import (
"net/http"
_ "net/http/pprof"
)
func main() {
go http.ListenAndServe("0.0.0.0:6001", nil)
/*
业务代码
*/
}
/*
go tool pprof -http=:8081 http://ip:port/debug/pprof/allocs
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment