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

Use GOPATH from env if dlv not found #725

Merged
merged 1 commit into from
Jan 19, 2017

Conversation

ramya-rao-a
Copy link
Contributor

No description provided.

if (!existsSync(dlv) && env['GOPATH'] && !process.env['GOPATH']) {
process.env['GOPATH'] = env['GOPATH'];
dlv = getBinPath('dlv');
process.env['GOPATH'] = undefined;
Copy link

Choose a reason for hiding this comment

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

Wouldn't it be nicer if the getBinPath took an (optional) second argument called gopath and used that instead of changing the process.env['GOPATH']?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, I like it :)

@ramya-rao-a
Copy link
Contributor Author

@tw1nk Updated as per your suggestion. I agree, its much cleaner this way. Thanks!

@ramya-rao-a ramya-rao-a merged commit a1a162a into microsoft:master Jan 19, 2017
@ramya-rao-a ramya-rao-a deleted the debug-use-env-gopath branch January 29, 2017 23:17
@guogeer
Copy link

guogeer commented Feb 9, 2017

image
I update vscode-go version to newest and there is a error. like above image, if launch config miss env option,it happen Failed to continue: "TypeError: Cannot read property 'GOPATH' of undefined.

@ramya-rao-a
Copy link
Contributor Author

Thanks @guogeer, I found this the other day too. The fix is already in master. The next update of the Go extension will have the fix.

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.

5 participants