From d8802a6c2f96641062847c48d7a7e58cf4fe539a Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Sun, 15 Jan 2017 17:13:36 -0800 Subject: [PATCH] Use GOPATH from env if dlv not found --- src/debugAdapter/goDebug.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index acc6e2d77..9cedd1025 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -169,6 +169,14 @@ class Delve { return; } let dlv = getBinPath('dlv'); + + // If dlv not found, try using the GOPATH that was set in env in launch.json + if (!existsSync(dlv) && env['GOPATH'] && !process.env['GOPATH']) { + process.env['GOPATH'] = env['GOPATH']; + dlv = getBinPath('dlv'); + process.env['GOPATH'] = undefined; + } + log('Using dlv at: ', dlv); if (!existsSync(dlv)) { return reject(`Cannot find Delve debugger at ${dlv}. Ensure it is in your "GOPATH/bin" or "PATH".`);