Tool to download the Go(lang) releases.
This is helpful to avoid continually downloading the binaries repeatedly.
It's still in a very crude state (I probably won't do much to improve it, it does what I want).
Running this will check the Go download site and download all of the releases into folders in the current directory matching the version.
If the file is already downloaded it will check size and hash to see if it matches the official version and if so it will skip downloading that file again.
The tool will also write a companion file with a .sha suffix, containing the hash of the downloaded file, which it uses to check hashes in future runs.
By default the tool no longer mirrors every file of every release (that grew to hundreds of GB of platforms that never get used). It now mirrors a practical subset, controlled by a few variables near the top of main.go:
keepOS/keepArch— only these binary archives are downloaded (default:linux,darwin,windows×amd64,arm64). Installer packages (.pkg/.msi) and all other OS/arch combinations are skipped.- Source archives (
*.src.tar.gz) are always kept. latestPatchOnly(defaulttrue) — only the newest patch within eachmajor.minorline is mirrored (e.g. only the highestgo1.25.x), not every historical patch.skipWords— beta and rc releases are skipped, as before.
To mirror everything again, widen keepOS/keepArch and set latestPatchOnly = false.