If you have Go 1.21 or greater installed already, you no longer have to manually download and replace Go binaries to upgrade to a newer version. Using your existing Go toolchain, set the GOTOOLCHAIN environment variable to your desired Go version using the following commands.

go env -w GOTOOLCHAIN=go1.23.5+auto # Change 1.23.5 to your desired Go version

Finally, a GOTOOLCHAIN setting of the form version+auto means to use version by default but allow upgrades to newer versions as well. If you have Go 1.21.0 installed, then when Go 1.21.1 is released, you can change your system default by setting a default GOTOOLCHAIN:

Next, run go env -w to update to the new version. You’ll have to upgrade your development tools as well. Personally, I use the “Update Go Tools” command in VSCode that’s enabled after installing the Go language extension.

/