]> Cypherpunks repositories - gostls13.git/commitdiff
doc: make it clear which pprof package is used
authorJBD <jbd@google.com>
Wed, 13 Dec 2017 23:57:46 +0000 (15:57 -0800)
committerJBD <jbd@google.com>
Thu, 14 Dec 2017 17:40:20 +0000 (17:40 +0000)
Updates #22027.

Change-Id: I5a5bae77a744c7a2ecb75172846e6461a98ee8af
Reviewed-on: https://go-review.googlesource.com/83916
Reviewed-by: Andrew Bonventre <andybons@golang.org>
doc/diagnostics.html

index 7a37dd98e4379ea7f3a24464b1c3ce8d402ee046..f9d230e6bc1847e03002bb92da89abda73d8e93d 100644 (file)
@@ -185,9 +185,19 @@ handler on :7777 at /custom_debug_path/profile:
 
 <p>
 <pre>
-mux := http.NewServeMux()
-mux.HandleFunc("/custom_debug_path/profile", pprof.Profile)
-http.ListenAndServe(":7777", mux)
+package main
+
+import (
+       "log"
+       "net/http"
+       "net/http/pprof"
+)
+
+func main() {
+       mux := http.NewServeMux()
+       mux.HandleFunc("/custom_debug_path/profile", pprof.Profile)
+       log.Fatal(http.ListenAndServe(":7777", mux))
+}
 </pre>
 </p>