golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.87k stars 745 forks source link

Not able to install gopls and other tools on vs code , Installing golang.org/x/tools/gopls@latest FAILED, Error: Command failed: C:\Program Files\Go\bin\go.exe install -v honnef.co/go/tools/cmd/staticcheck@latest #3139

Closed sohanmh closed 7 months ago

sohanmh commented 8 months ago

What version of Go, VS Code & VS Code Go extension are you using?

go version go1.21.6 windows/amd64

Version Information
* Run `go version` to get version of Go from _the VS Code integrated terminal_. - * Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_. - * Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders. - * Check your installed extensions to get the version of the VS Code Go extension - * Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command. -

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file. Share all the settings with the go. or ["go"] or gopls prefixes.

Describe the bug

A clear and concise description of what the bug. A clear and concise description of what you expected to happen.

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

image
hyangah commented 8 months ago

Thanks for the report and the screenshot. Installation of these tools requires network access. Are you able to access `https://proxy.golang.org" from your machine?

If not, depending on your situation, try one of the followings to workaround.

Try in the setting "go.toolsEnvVars": { "GOPROXY": "direct" }. If you have other module proxy, you can set the proxy address instead of "direct". Reference: https://go.dev/ref/mod#communicating-with-proxies

Find a proxy and set HTTP_PROXY and HTTPS_PROXY environment variables to point to the proxy server address. Or talk to the network admin for help.

gopherbot commented 7 months ago

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)