Closed williandandrade closed 1 month ago
The Go project only supports the last two major releases, currently 1.22 and 1.21: https://go.dev/doc/devel/release#policy
gopls@latest requires at least Go 1.19: https://cs.opensource.google/go/x/tools/+/master:gopls/go.mod;l=3 The atomic.Int{32|64} types were added in Go 1.19: https://pkg.go.dev/sync/atomic#Int64
Yes, please reinstall with a supported version of Go. Soon, gopls will require at least Go 1.21 (+forward compatibility) to build: golang/go#65917.
I believe the extension should not have tried to install gopls@latest, since it should be knowledgeable of the last supported version. CC @hyangah in case there is a VS Code bug here.
According to https://github.com/golang/tools/tree/master/gopls#supported-go-versions gopls@v0.14.2 is the last version that can be built with go1.18.
VS Code still claims to support tools installation with go1.18, but that's incorrect. Please manually install gopls. I will update the README page and the error message.
go install golang.org/x/tools/gopls@v0.14.2
Thanks @hyangah. Transferring to the VS Code issue tracker.
Duplicate of #3409
gopls version
n/a
go env
What did you do?
Due to an onboarding on a project I fresh installed go@1.18 in my environment using
asdf
and tried to setup the VSCode's extension to start coding.What did you see happen?
Error when installing
gopls@latest
.What did you expect to see?
All the tools installed properly.
Editor and settings
No response
Logs