Skip to content

Commit

Permalink
fix for microsoft#934
Browse files Browse the repository at this point in the history
  • Loading branch information
goenning committed Apr 19, 2017
1 parent 6ea85f0 commit 8d59f67
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/debugAdapter/goDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,6 @@ class Delve {
return reject('The program attribute must point to valid directory, .go file or executable.');
}

// Consolidate env vars
let finalEnv: Object = null;
if (Object.keys(env).length > 0) {
finalEnv = {};
for (let k in process.env) {
finalEnv[k] = process.env[k];
}
for (let k in env) {
finalEnv[k] = env[k];
}
}

if (!!launchArgs.noDebug && mode === 'debug' && !isProgramDirectory) {
this.debugProcess = spawn(getGoRuntimePath(), ['run', program], {env: finalEnv});
this.debugProcess.stderr.on('data', chunk => {
Expand Down Expand Up @@ -269,6 +257,19 @@ class Delve {
}
}


// Consolidate env vars
let finalEnv: Object = null;
if (Object.keys(env).length > 0) {
finalEnv = {};
for (let k in process.env) {
finalEnv[k] = process.env[k];
}
for (let k in env) {
finalEnv[k] = env[k];
}
}

let dlv = getBinPathWithPreferredGopath('dlv', resolvePath(env['GOPATH']));

if (!existsSync(dlv)) {
Expand Down

0 comments on commit 8d59f67

Please sign in to comment.