Go Download
Before You Start
- Applies to: Go 1.21+ (examples verified with Go 1.22) · Prerequisites: Get Started · Read time: about 5 min
Install the latest version of Go. For instructions on downloading and installing the Go compiler, tools, and libraries, please visit the Go language download page.
Starting from Go 1.13, the go command uses the Go module mirror and the Go checksum database run by Google to download and verify modules by default. For privacy information about these services, please see https://proxy.golang.org/privacy. For configuration details (including how to disable these servers or use different servers), please refer to the go command documentation.
Go 1.26.0
Go 1.25.7
Go 1.25.6
Complete Example
The program below runs as-is: copy it into a file and execute go run main.go, or paste it into the Go Playground.
go
package main
import (
"fmt"
"runtime"
"strings"
)
func main() {
supportedOS := map[string]bool{"linux": true, "darwin": true, "windows": true}
v := runtime.Version()
fmt.Println("Go 1.x release:", strings.HasPrefix(v, "go1."))
fmt.Println("current OS in supported list:", supportedOS[runtime.GOOS])
}Expected output:
text
Go 1.x release: true
current OS in supported list: trueCommon Pitfalls
- Download the archive for your OS and architecture.
darwinis macOS;amd64is x86-64 andarm64is Apple Silicon / ARM servers. - Verify the checksum after downloading. Compare the downloaded file against the published SHA256; a truncated archive fails in confusing ways later.
- Do not mix installation methods. If you installed Go via a package manager, upgrade through it instead of unpacking a tarball over it.
- Remove old versions from PATH. Multiple
gobinaries compete; check withgo versionandwhich -a go. - Keep the default
GOROOT. Only setGOROOTwhen you installed Go in a non-standard location — most users never need it.
Change Log
- 2026-10-14: Added "Before You Start" notes, a complete runnable example with expected output, common pitfalls, and this change log. Fixed a malformed download URL.
