diff options
| author | Jeff Carr <[email protected]> | 2025-10-05 12:32:18 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-05 12:32:18 -0500 |
| commit | 4d813225e061e02d5a81f2294c30228fb54e6901 (patch) | |
| tree | 0f33fbaace108d22adaf552290a718a08c3c35b1 /debug.go | |
| parent | f321b46d043cebff9fec20a657c361ef5237f24b (diff) | |
odd debug code for later
Diffstat (limited to 'debug.go')
| -rw-r--r-- | debug.go | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -6,9 +6,13 @@ package main // An app to submit patches for the 30 GO GUI repos import ( + "debug/buildinfo" "fmt" + "os" + "path/filepath" "time" + "go.wit.com/dev/davecgh/spew" "go.wit.com/gui" "go.wit.com/lib/debugger" "go.wit.com/lib/gui/shell" @@ -26,6 +30,35 @@ func init() { } } +func dumpDebug() { + // Get absolute path of the currently running binary + exePath, err := os.Executable() + if err != nil { + fmt.Println("Error getting executable path:", err) + return + } + + // Resolve symlinks if necessary + exePath, err = filepath.EvalSymlinks(exePath) + if err != nil { + fmt.Println("Error resolving symlink:", err) + return + } + + // Read build info + bi, err := buildinfo.ReadFile(exePath) + if err != nil { + fmt.Println("Error reading build info:", err) + return + } + + log.Infof("%s built with Go version: %s\n", exePath, bi.GoVersion) + spew.Dump(bi) + for _, dep := range bi.Deps { + fmt.Printf("Dependency: %s %s\n", dep.Path, dep.Version) + } +} + func debug() { defer func() { if r := recover(); r != nil { |
