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

set GOPATH for debug adaptor automatically#904

Merged
ramya-rao-a merged 2 commits intomicrosoft:masterfrom
esjeon:debug-with-gopath
Apr 3, 2017
Merged

set GOPATH for debug adaptor automatically#904
ramya-rao-a merged 2 commits intomicrosoft:masterfrom
esjeon:debug-with-gopath

Conversation

@esjeon
Copy link
Copy Markdown
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
Copy Markdown

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
}

if (!config.env || !config.env['GOPATH']) {
let binpath = getBinPath('dlv');
Copy link
Copy Markdown
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
Copy Markdown
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