god dam it

This commit is contained in:
Sasha Koshka 2023-03-08 20:30:13 -05:00
parent 4cd4374e38
commit f7ee80c8f9
2 changed files with 9 additions and 3 deletions

View File

@ -1,9 +1,15 @@
# ezprof
Host pprof at localhost:8888 in one line. In any Go file, put:
Host pprof at localhost:8888. In any Go file, put:
```go
import _ "git.tebibyte.media/sashakoshka/ezprof/hook"
import "git.tebibyte.media/sashakoshka/ezprof/ez"
func main () {
...
ez.Prof()
...
}
```
And you will be able to connect to your program with the pprof tool.

View File

@ -3,7 +3,7 @@ package hook
import "net/http"
import _ "net/http/pprof"
func init () {
func Prof () {
go func () {
err := http.ListenAndServe("localhost:9090", nil)
if err != nil { panic(err.Error()) }