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

set GOPATH for debug adaptor automatically #904

Merged
merged 2 commits into from
Apr 3, 2017

Conversation

esjeon
Copy link
Contributor

@esjeon esjeon commented Apr 1, 2017

This patch modifies go.debug.startSession command to add environment variable 'GOPATH' to launch configuration JSON object. A proper GOPATH is searched using getBinPath, which utilizes VSCode settings.

This allows more versatile configuration and provides better out-of-box experience.

@msftclas
Copy link

msftclas commented Apr 1, 2017

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

src/goMain.ts Outdated
@@ -196,6 +196,14 @@ export function activate(ctx: vscode.ExtensionContext): void {
'program': '${file}'
});
}

if (!config.env || !config.env['GOPATH']) {
let binpath = getBinPath('dlv');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tried config.env['GOPATH'] = process.env['GOPATH'] ?

@ramya-rao-a
Copy link
Contributor

@esjeon Good catch in finding the bug

I have updated your branch with a simpler way of getting the GOPATH.

Will merge the PR as soon as the tests are green

@ramya-rao-a ramya-rao-a merged commit dad451c into microsoft:master Apr 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants