Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Use GOPATH from env if dlv not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jan 16, 2017
1 parent ddb434c commit d8802a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/debugAdapter/goDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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".`);
Expand Down

0 comments on commit d8802a6

Please sign in to comment.