Go
A small, statically typed language from Google that compiles in seconds to one static binary, with goroutines, channels and a garbage collector built in.
- What it is
- Programming languages (compiled to machine code)
- Type
- Open source
- Made by
- Google (the Go team)
- License
- BSD 3-Clause
- Facts checked
- 8 October 2026
What it is
Go compiles ahead of time to machine code. The standard gc toolchain links statically by default, so a program ships as one file that carries the Go runtime with it: the scheduler, the garbage collector and the type information needed for reflection and panic stack traces. Setting GOOS and GOARCH picks the target, so building a Linux ARM binary on a Mac is one environment variable away. Unused imports are a compile error, not a warning, which keeps dependency graphs honest and builds fast.
Concurrency is in the language. go f() starts a goroutine, a function that the runtime multiplexes onto a small pool of operating system threads; a new goroutine gets a stack of a few kilobytes that grows and shrinks as needed, so hundreds of thousands can run in one process. Goroutines talk over typed channels, an idea taken from Tony Hoare’s Communicating Sequential Processes, summed up in the Go proverb “Do not communicate by sharing memory. Instead, share memory by communicating.” Memory is managed by a concurrent, non-moving mark-and-sweep garbage collector whose pauses are often under a millisecond. Since Go 1 in 2012, code written for an older 1.x release is promised to keep compiling; generics arrived in Go 1.18 (March 2022), and the latest releases are Go 1.26 (February 2026) and Go 1.27 (August 2026).
Why teams pick it
- Fast builds and one statically linked binary per program, so a deploy can be a single file copy
- Goroutines and channels make concurrent network servers straightforward, with a runtime that parks blocked goroutines for you
- A small language with one formatting style (
gofmt) and a strict compatibility promise since Go 1, so old code keeps compiling - Cross-compiling to another OS or CPU is built in: set
GOOSandGOARCHand build
Watch out for
- A garbage collector and a runtime come with every binary, which costs memory and CPU time that C, C++, Rust or Zig programs don’t pay
- Deliberately few features: no exceptions, no inheritance, and generics only since 1.18, so some code is more repetitive than in richer languages
- Maps aren’t safe for concurrent writes, and channels don’t prevent data races; the race detector finds them only at run time
- Calling C through
cgoneeds a C toolchain for every target, andcgois off by default when cross-compiling, so mixed Go and C code loses the easy cross-builds
Alternatives
What all compiled to machine code have in common →How it fits with other technologies
Three goroutines send results over a channel · go
package main
import "fmt"
func square(n int, results chan<- int) {
results <- n * n
}
func main() {
results := make(chan int)
for n := 1; n <= 3; n++ {
go square(n, results) // three goroutines run concurrently
}
sum := 0
for range 3 {
sum += <-results // receiving blocks until a goroutine sends
}
fmt.Println("sum of squares:", sum) // sum of squares: 14
}See it in a real stack
No architecture uses Go yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2007–2026
By 2007, Google’s servers were written mostly in C++ and Java, and building them had become slow. Rob Pike’s account of the time describes one major Google binary of about 2,000 source files (4.2 MB) that expanded, through repeated #includes, into more than 8 GB of compiler input, and took 45 minutes to build even on a distributed build system. Programmers who wanted to move fast were drifting to dynamic languages such as Python, giving up safety and speed.
On 21 September 2007, Robert Griesemer, Rob Pike and Ken Thompson started sketching a new language on a whiteboard. Thompson had a first compiler by January 2008, Ian Taylor started a GCC front end that May, and Russ Cox joined late that year. Google released Go as an open-source project on 10 November 2009, promising builds that “feel instantaneous” and code that “runs close to the speed of C”.
Go 1, in March 2012, froze the language and standard library under a compatibility promise. Go then became the language of much cloud infrastructure, including Docker, Kubernetes and Terraform.
Why it’s built this way
- Explicit, enforced dependencies
- C++ headers made every build reread the same files thousands of times. In Go a package imports only what it uses, an unused import is a compile error, and compiled packages carry what their importers need, so builds stay fast as code grows.
- Garbage collection, not manual memory management
- Freeing memory safely is the hardest part of concurrent code, because objects pass between threads. The designers judged that a modern collector could be cheap and low-latency enough for network servers, and that it makes interfaces simpler too.
- Goroutines and channels in the language
- Borrowed from CSP via Newsqueak and Limbo: cheap goroutines on growable stacks let a server use one goroutine per connection, and the runtime moves others off a thread that blocks in a system call.
- A small language and a stability promise
- Go 1 was a cleanup release that then froze, so “programs will continue to compile and run without change … on a time scale of years”; new features come slowly.
Timeline
- 2007
Griesemer, Pike and Thompson sketch the language on 21 September
- 2009
Released as open source on 10 November
- 2012
Go 1 and its compatibility promise, 28 March
- 2022
Go 1.18 adds generics (type parameters) in March
- 2026
Go 1.27 released on 19 August
- Go FAQ: history of the project, why a new language, ancestors, goroutines, garbage collection
- Rob Pike: Go at Google, Language Design in the Service of Software Engineering (2012)
- Google Open Source Blog: Hey! Ho! Let’s Go! (November 2009)
- Go blog: Go version 1 is released (March 2012)
- Go 1.18 release notes (generics)
- Go release history (go1 2012-03-28, go1.18 2022-03-15, go1.27.0 2026-08-19)
Sources13 · facts checked 8 October 2026
- Go FAQ: goroutines, CSP, statically linked binaries, garbage collector pauses
- Effective Go: concurrency and share memory by communicating
- Go docs: A guide to the Go garbage collector (mark-sweep, non-moving)
- Go docs: Installing Go from source ($GOOS and $GOARCH; always cross-compiling)
- Rob Pike: Go at Google (unused imports are a compile error)
- Go 1.18 release notes (generics)
- Go command docs: cgo (calling C; disabled by default when cross-compiling)
- Go docs: Data race detector (finds only races that happen at run time)
- Go release history
- Go license (BSD 3-Clause)
- GitHub: kubernetes/kubernetes (written in Go)
- GitHub: moby/moby, the Docker engine (written in Go)
- GitHub: hashicorp/terraform (written in Go)