summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-06-11 22:04:50 -0400
committerdemo <demo@antix1>2026-06-11 22:04:50 -0400
commit7645b465a687f582e363e6506a869c491cb431a6 (patch)
tree3e54a38fa2c9b3a6b5076a0691a12650fa443ba9
parentcb6060a60a834afb086c0a8978d70ab9a41c6a76 (diff)
feat: check that GOEXPERIMENT=goroutineleakprofile is set
-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)