summaryrefslogtreecommitdiff
path: root/shared/debug.go
blob: 0c9ba4f9507e9ee344bfd57dfbe2dec8dfd2ddda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package shared

import (
	"os"
	"os/exec"
)

// Finds the Delve binary to use. Either uses the SOONG_DELVE_PATH environment
// variable or if that is unset, looks at $PATH.
func ResolveDelveBinary() string {
	result := os.Getenv("SOONG_DELVE_PATH")
	if result == "" {
		result, _ = exec.LookPath("dlv")
	}

	return result
}