From 99bc2a10b093dd31f084154f764344d74e6794bd Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Mon, 27 Mar 2017 10:26:34 -0700 Subject: [PATCH] main: replace manhole with gopreload --- gopreload.go | 9 +++++++++ manhole.go | 22 ---------------------- 2 files changed, 9 insertions(+), 22 deletions(-) create mode 100644 gopreload.go delete mode 100644 manhole.go diff --git a/gopreload.go b/gopreload.go new file mode 100644 index 0000000..6829ae5 --- /dev/null +++ b/gopreload.go @@ -0,0 +1,9 @@ +// gopreload.go +package main + +/* + This file is separate to make it very easy to both add into an application, but + also very easy to remove. +*/ + +import _ "github.com/Xe/gopreload" diff --git a/manhole.go b/manhole.go deleted file mode 100644 index 1d542bc..0000000 --- a/manhole.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "log" - "net" - "net/http" - _ "net/http/pprof" - "net/rpc" -) - -func init() { - l, err := net.Listen("tcp", "127.0.0.2:0") - if err != nil { - log.Printf("manhole: cannot bind to 127.0.0.2:0: %v", err) - return - } - - log.Printf("manhole: Now listening on http://%s", l.Addr()) - - rpc.HandleHTTP() - go http.Serve(l, nil) -}