So, I installed Golang using apt (inside WSL Ubuntu Linux); created a project outside GOROOT with go mod init, then want to update to the latest Go version (1.15.5).
The easiest way to do this (as far as I have experimented), is using gvm. (Similarly, Python => pyenv; Node.js => nvm; Ruby => rbenv; Java => SDKman.)
zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# or bash < <(...)
Then, edit the ./go.mod
go 1.15.5
I think, knowing this is important, when you are using go mod, because go version will then be fixed inside go.mod.
Actually, VSCode itself can also choose go version, but much less flexible.
Top comments (0)