Go
Go is a statically typed, compiled language designed at Google for simplicity and productivity. It compiles to a single binary with no dependencies, starts up instantly, and handles concurrency through goroutines and channels rather than threads and locks. The standard library covers HTTP servers, JSON, crypto, testing, and more - most Go projects need few external dependencies.
Overview
- What: Compiled language with garbage collection, structural typing, and built-in concurrency
- Install: go.dev/dl or
brew install go - Init:
go mod init github.com/you/project - Build:
go build(produces a single static binary) - Run:
go run main.go - Test:
go test ./... - Use cases: APIs, CLIs, cloud infrastructure (Docker, Kubernetes, Terraform), DevOps tooling
Contents
- Concepts - Core language ideas
- Concurrency - Goroutines, channels, select, context
- Interfaces - Implicit satisfaction, composition, best practices
- Error Handling - Errors as values, wrapping, sentinel errors
- Quickstart - Get running fast
- Setup - Install, project structure, tooling
- API Server - REST API with stdlib net/http
- Deep Dives - Advanced patterns and ecosystem
- Generics - Type parameters, constraints, when to use
- Concurrency Patterns - Worker pools, pipelines, fan-out
- Testing - Table-driven tests, benchmarks, fuzzing
- Ecosystem - Frameworks, libraries, and Go vs Rust
- Notes - Practical tips
- Gotchas - Common pitfalls and recent changes