on 94de6bc help sign in
crush/main.go
24 lines 447 B history raw
1package main
3import (
4 "log/slog"
5 "net/http"
6 _ "net/http/pprof"
7 "os"
9 "github.com/charmbracelet/crush/internal/cmd"
10 _ "github.com/joho/godotenv/autoload"
13func main() {
14 if os.Getenv("CRUSH_PROFILE") != "" {
15 go func() {
16 slog.Info("Serving pprof at localhost:6060")
17 if httpErr := http.ListenAndServe("localhost:6060", nil); httpErr != nil {
18 slog.Error("Failed to pprof listen", "error", httpErr)
19 }
20 }()
21 }
23 cmd.Execute()