Lukacs T. Berki | 7690c09 | 2021-02-26 14:27:36 +0100 | [diff] [blame^] | 1 | package shared |
2 | |||||
3 | import ( | ||||
4 | "os" | ||||
5 | "os/exec" | ||||
6 | ) | ||||
7 | |||||
8 | // Finds the Delve binary to use. Either uses the SOONG_DELVE_PATH environment | ||||
9 | // variable or if that is unset, looks at $PATH. | ||||
10 | func ResolveDelveBinary() string { | ||||
11 | result := os.Getenv("SOONG_DELVE_PATH") | ||||
12 | if result == "" { | ||||
13 | result, _ = exec.LookPath("dlv") | ||||
14 | } | ||||
15 | |||||
16 | return result | ||||
17 | } |