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

use the user's GOPROXY settings when requesting the gopls version #2774

Merged
merged 8 commits into from
Oct 17, 2019
Merged

use the user's GOPROXY settings when requesting the gopls version #2774

merged 8 commits into from
Oct 17, 2019

Conversation

stamblerre
Copy link
Contributor

I think this change, in conjunction with the setting to disable gopls automatic updates might be enough to solve the issue with making requests directly.

@stamblerre
Copy link
Contributor Author

stamblerre commented Sep 24, 2019

After some discussion with teammates, this is the correct approach for the gopls automatic updates. $GOPROXY wasn't on by default when I made the original PR, which is why I had used https://proxy.golang.org directly. With Go 1.13, GOPROXY is on by default, so this should be fine. It will be used when running the go command anyway, so I think it's fine to have this as opt-out with a setting to disable.

return null;
}

async function goProxy(): Promise<string[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

We plan to do this not more than once per each VS Code session right?
If so, then on start up, we do run go env GOPATH GOROOT.
We can append GOPROXY to that and have the value stored in process.env['GOPROXY'] and skip the below.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe re-using that go env call is a good move. If you agree, you can cherry pick this commit of mine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks!

@ramya-rao-a ramya-rao-a merged commit 066bdbc into microsoft:master Oct 17, 2019
@stamblerre stamblerre deleted the proxy branch November 12, 2019 19:46
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.

2 participants