summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index db41eab..a4f6d46 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ import (
"fmt"
"log"
"net/url"
+ "os"
"runtime/pprof"
"strings"
"time"
@@ -15,6 +16,10 @@ import (
)
func main() {
+ if os.Getenv("GOEXPERIMENT") != "goroutineleakprofile" {
+ log.Fatal("Missing GOEXPERIMENT=goroutineleakprofile environment setting")
+ }
+
// Setting shorfile helps especially for when we log errors
// without returning them.
log.SetFlags(log.LstdFlags | log.Lshortfile)