golang / vscode-go

Go extension for Visual Studio Code

Home Page:https://marketplace.visualstudio.com/items?itemName=golang.Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show a pop-up to help returning users upgrade their environments

stamblerre opened this issue · comments

Hi Tools team 😄 ❤️

I was just trying to use Go for a personal project, and I had a very old version of Go and of gopls installed on my computer. The version of Go was actually so old that it wouldn't build gopls, and I kept getting this error message:

go install -v golang.org/x/tools/gopls@latest
package golang.org/x/tools/gopls
	imports golang.org/x/tools/gopls/internal/cmd
	imports golang.org/x/tools/gopls/internal/vulncheck/scan: build constraints exclude all Go files in /Users/rstambler/code/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/vulncheck/scan
package golang.org/x/tools/gopls
	imports golang.org/x/tools/gopls/internal/cmd
	imports golang.org/x/tools/gopls/internal/cache
	imports golang.org/x/tools/gopls/internal/vulncheck/semver: build constraints exclude all Go files in /Users/rstambler/code/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/vulncheck/semver

At this point, I imagine there are many people out there who have installed some old version of Go, and they might be frustrated if they try Go again some years later. I wonder if there isn't a way for VS Code to come up with an alert that say something like "Welcome back! Your version of Go is no longer supported. Click here to update to the latest version and rebuild all of your Go tools." or something like that.

Hope this isn't a duplicate issue & excited to play with the latest version of all these great tools! 😄

Welcome back from the wilderness, Rebecca!

Another option here would be to have a main_outdated.go file that produces a more useful error, such as undefined: THIS_GO_VERSION_IS_UNSUPPORTED.

However, forward compatibility means that this is only an issue for users of Go versions older than 1.21 (Rebecca: starting in a few weeks we're going to be able to require the latest version of Go to build gopls!

So the particular problem of upgrading gopls will become less and less severe over time. @hyangah doesn't the extension already prompt users to upgrade Go? I wonder if it is sufficient to improve that popup?

We discussed in our triage meeting (started by you!) and decided this is not worth doing, thanks to the forward compatibility mentioned above (requested by you!).

@hyangah doesn't the extension already prompt users to upgrade Go? I wonder if it is sufficient to improve that popup?

It sounds like since there was an old gopls that was compatible with the old go, there was no problem the extension should report. But when trying to upgrade or reinstall gopls, the old go version wasn't compatible with the latest gopls. The latest version of extension still allowed go1.18 for tools installation (this bug was fixed in the master, but we didn't release the extension with the fix)

I agree that once the extension stops allowing go1.20 or older (#3411), this isn't worth doing.