Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: gopls: failed to install [read "https:/proxy.golang.org/@v/v0.1.0.zip": stream error: stream ID 9; NO_ERROR; received from peer]

While opening my Go project in VSCode or using the Go: install/update tools command I am getting the following error:

1 tools failed to install.

gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: /usr/local/bin/go install -v golang.org/x/tools/gopls@latest
go: downloading golang.org/x/sys v0.1.0
../../pkg/mod/golang.org/x/[email protected]/go/packages/external.go:15:2: golang.org/x/[email protected]: read "https:/proxy.golang.org/@v/v0.1.0.zip": stream error: stream ID 9; NO_ERROR; received from peer

GOPATH is set properly (other tools were installed successfully).

Versions:

  • VSCode: 1.73.1
  • Golang: 1.19.3.
like image 217
Saikat Avatar asked Dec 01 '25 11:12

Saikat


1 Answers

Found a workaround:

I updated the GOPROXY environment variable:

export GOPROXY="direct"

It started working after that.

Maybe some network issue within my company proxy was causing this in the first place.

Note: Add the statement to your respective shell profile to make this change permanent.

like image 73
Saikat Avatar answered Dec 03 '25 04:12

Saikat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!