# Go — The Go Programming Language from Google > Go is an open-source programming language designed at Google by Rob Pike, Ken Thompson, and Robert Griesemer. Fast compilation, garbage collection, built-in concurrency via goroutines and channels, and a massive standard library. Powers Docker, Kubernetes, and most cloud infrastructure. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash # Install brew install go # macOS sudo snap install go --classic # Linux # Or download from https://go.dev/dl go version ``` Hello world: ```go // main.go package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello from Go") }) fmt.Println("Listening on :8080") http.ListenAndServe(":8080", nil) } ``` Run and build: ```bash go mod init myapp go run main.go go build -o myapp main.go GOOS=linux GOARCH=amd64 go build -o myapp-linux main.go go test ./... go vet ./... go install tool ``` ## Intro Go (often called Golang) is an open-source programming language designed at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. Designed for simplicity, fast compilation, and effective concurrency. Now the lingua franca of cloud infrastructure: Docker, Kubernetes, Terraform, Prometheus, CockroachDB, etcd, and many more are written in Go. - **Repo**: https://github.com/golang/go - **Stars**: 133K+ - **License**: BSD 3-Clause ## What Go Does - **Compiled** — fast native binaries, cross-compile - **Garbage collected** — low-pause GC optimized for latency - **Static typing** — with type inference via `:=` - **Goroutines** — cheap concurrent functions (thousands per MB) - **Channels** — CSP-style communication between goroutines - **Interfaces** — structural typing, no inheritance - **Standard library** — HTTP, crypto, JSON, SQL all in stdlib - **Tooling** — go fmt, vet, test, doc, mod built in - **Modules** — dependency management since Go 1.11 - **Generics** — since Go 1.18 ## Architecture Compiler (gc) written in Go itself, plus gccgo alternative. Runtime manages goroutine scheduler (M:N mapping to OS threads), memory allocator, and garbage collector. Single static binary output — no DLL hell. ## Self-Hosting Language toolchain. Installs via official installer or package manager. ## Key Features - Single static binary output - Lightning-fast compilation - Cross-compilation (GOOS/GOARCH) - Goroutines + channels - Rich standard library - go fmt canonical formatting - Comprehensive tooling (test, vet, doc) - Generics (since 1.18) - Fuzzing (since 1.18) - Workspaces for multi-module dev ## Comparison | Language | Concurrency | Compilation | GC | Typical Use | |---|---|---|---|---| | Go | Goroutines/CSP | Fast | Yes | Cloud infra | | Rust | Async + threads | Slow | No (ownership) | Systems | | Java | Threads + Project Loom | Medium | Yes | Enterprise | | Python | asyncio | Interpreted | Yes | Scripts, ML | | C++ | Threads + coroutines | Slow | No | Performance | | Node.js | Event loop | JIT | Yes | Web APIs | ## FAQ **Q: Is Go good for web development?** A: Very suitable. The standard library has a complete HTTP server, plus frameworks like Gin, Echo, Fiber, and Chi. Go is also a top choice for microservices and gRPC backends. **Q: When were generics added?** A: Go 1.18 (March 2022). Before that, you had to rely on interface{} or code generation; now you can write truly type-parameterized functions and types. **Q: Difference between goroutines and OS threads?** A: Goroutines are user-space coroutines managed by the Go runtime, with an initial stack of 2KB (vs 1-8MB for OS threads). The scheduler multiplexes goroutines M:N on OS threads, so you can easily spawn millions. ## Sources - Docs: https://go.dev/doc - GitHub: https://github.com/golang/go - License: BSD 3-Clause --- Source: https://tokrepo.com/en/workflows/go-go-programming-language-google-1b74877a Author: Script Depot