From b9f13de90858da2925402096328e0c448bb33870 Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Wed, 11 Dec 2024 23:05:00 +0100 Subject: [PATCH] http/pprof: update readme The readme for `http/pprof` doesn't compile currently: `Profile` is a `HandlerFunc`, not a `Handler`. --- http/pprof/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http/pprof/README.md b/http/pprof/README.md index 0a767024..d340f094 100644 --- a/http/pprof/README.md +++ b/http/pprof/README.md @@ -21,6 +21,8 @@ the `net/http/pprof` package is imported by dependencies, and therefore there is reliable way to avoid the conflict. ```go +package main + import ( "net/http" @@ -28,7 +30,7 @@ import ( ) func main() { - http.Handle("/debug/pprof/cpu", pprof.Profile()) + http.HandleFunc("/debug/pprof/cpu", pprof.Profile) } ```