# Go
Go (often called Golang for searchability) is a statically-typed, compiled programming language created at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It was first released in 2009 and reached version 1.0 in 2012. The design goal was a language that compiles fast, runs fast, and stays simple enough that a team of engineers can read each other's code without ceremony.
Go's value proposition is opinionated: one way to format code (`gofmt`), one canonical toolchain (`go build`, `go test`, `go mod`), small surface area, no inheritance, no generics for over a decade (added in 1.18), and a runtime built around lightweight goroutines and channels for concurrency.
## Why It Wins for CLIs and Infra
The defining superpower for tooling: `go build` produces a **single static binary** with no runtime dependency, cross-compiles trivially (`GOOS=linux GOARCH=arm64 go build`), and starts in milliseconds. Combined with a strong standard library for networking, HTTP, JSON, and crypto, this makes Go the default choice for cloud-native infrastructure and developer CLIs.
Most of the modern infrastructure stack is written in Go: [[Docker]], [[Kubernetes]], Terraform, Prometheus, etcd, CockroachDB, the [[GitHub]] CLI, Hugo, Caddy, Tailscale. Newer entrants in the AI agent tooling space follow the same pattern ; for example [[Crabbox]] ships its CLI as a Go binary so it can be installed via [[Homebrew]] and run anywhere with no Node, Python, or runtime dependency.
## Concurrency Model
Goroutines are user-space threads scheduled by the Go runtime onto a small pool of OS threads. Channels are typed conduits between goroutines. The combination encourages a "share memory by communicating" style instead of locks-and-condition-variables. The runtime cost of a goroutine is in the kilobytes, so spawning hundreds of thousands of them is normal.
```go
ch := make(chan string, 10)
for _, url := range urls {
go func(u string) { ch <- fetch(u) }(url)
}
for range urls {
fmt.Println(<-ch)
}
```
## Where It Doesn't Shine
- **GUI / mobile apps**: not the natural home; Swift, Kotlin, Flutter dominate
- **Numerical / data science**: Python, Julia, and the JVM ecosystem are far ahead
- **Strict zero-cost abstraction**: [[Rust]] is a better fit when every cycle matters and you can pay the borrow-checker tax
## Tooling Highlights
- **`go run` / `go build` / `go test`**: zero-config dev loop
- **`go mod`**: built-in dependency management, content-addressed module cache
- **`gofmt` / `go vet` / `staticcheck`**: opinionated formatting and static analysis
- **`pprof`**: built-in profiling for CPU, heap, goroutines
- **`go work`**: workspace mode for multi-module repos
## References
- Official site: https://go.dev/
- Effective Go: https://go.dev/doc/effective_go
- Tour of Go: https://go.dev/tour/
## Related
- [[Rust]]
- [[TypeScript]]
- [[Docker]]
- [[Kubernetes]]
- [[Crabbox]]