Go 1.21 will (probably) download newer toolchains on demand by default

Go 1.21 is set to automatically download newer toolchains on demand, which some developers may find concerning. Previously, Go modules would try to work with older versions of Go regardless of whether they require a newer version. However, from version 1.21 onward, if a module requires a newer version, Go will refuse to start if it can’t find it. To address this issue, Go offers two ways out. First, it searches through $PATH to find the necessary toolchain version and automatically switches to it. Second, it can download an official release to use if one is available. While convenient, some may view downloading toolchain binaries from the internet with concern. Users can disable this feature by setting GOTOOLCHAIN to “local” or “path.”

https://utcc.utoronto.ca/~cks/space/blog/programming/Go121ToolchainDownloads

To top