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

Commit

Permalink
Pass current GOPATH to Delve. Fix for 1057 (#1065)
Browse files Browse the repository at this point in the history
* pass current GOPATH to Delve

* pass current GOPATH to Delve
  • Loading branch information
goenning authored and ramya-rao-a committed Jul 8, 2017
1 parent 8344b4c commit cf6a40d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/goRunTestCodelens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export class GoRunTestCodeLensProvider implements CodeLensProvider {
'name': 'Launch',
'type': 'go',
'request': 'launch',
'mode': 'test'
'mode': 'test',
'env': {
'GOPATH': process.env['GOPATH'] // Passing current GOPATH to Delve as it runs in another process
}
};

public provideCodeLenses(document: TextDocument, token: CancellationToken): CodeLens[] | Thenable<CodeLens[]> {
Expand Down Expand Up @@ -69,7 +72,7 @@ export class GoRunTestCodeLensProvider implements CodeLensProvider {

const args = ['-test.run', func.name];
const program = path.dirname(document.fileName);
const env = vsConfig['testEnvVars'] || {};
const env = Object.assign({ }, this.debugConfig.env, vsConfig['testEnvVars']);
const envFile = vsConfig['testEnvFile'];

let config = Object.assign({}, this.debugConfig, { args, program, env, envFile });
Expand Down

0 comments on commit cf6a40d

Please sign in to comment.