Go From Zero
Learn Go from nothing to genuinely advanced: install it and the basics, then the deep half - interfaces, generics, real concurrency patterns, error handling, the runtime scheduler and GC, testing and profiling, the standard library, and performance - all mental-model-first, with clear explanations.
Download EPUB- Install & Your First Program Install the Go toolchain from go.dev, confirm it with go version, write a tiny hello.go, run it with go run - and meet Go's surprise: unused imports and variables are compile errors, not warnings.
- Syntax, Values & Types Declare values with var and the := shortcut, understand Go's static typing and basic types, rely on zero values so nothing is ever uninitialized, and print with Println and Printf - plus the two gotchas that trip up newcomers.
- Collections Arrays vs slices (the one you'll actually use), growing slices with append, len and cap, key-value maps, and looping over both with range - including the nil-map panic and slice-aliasing surprises that catch everyone once.
- Control Flow & Functions Make decisions with if (including its init statement) and switch, loop with Go's single for (it has no other), write functions that return multiple values - the signature that defines Go - and meet defer.
- Modules & Project Layout Turn a folder into a module with go mod init, split code into packages, learn why a capital first letter makes an identifier public, import your own and others' packages, know go build vs go run, and lay out a small project sanely.
- Goroutines & Channels - Go's Concurrency A goroutine is a cheap concurrent task you start with the word 'go'; channels are typed pipes that pass values between goroutines and synchronize them, so you share memory by communicating instead of locking it.
- Errors & I/O - Errors Are Values In Go an error is an ordinary value you check with 'if err != nil', return up the call stack, wrap with %w, and inspect using errors.Is and errors.As - plus reading files with os and bufio, and why panic/recover is the rare exception.
- The Ecosystem & Tooling - Batteries Included Go ships one toolchain that does everything: go build, go run, go test, go vet, and go fmt (which ends formatting debates), go mod for dependencies, a strong standard library, and golangci-lint as the one extra you'll want.
- Idioms & Common Gotchas The conventions that make Go feel like Go - small implicitly-satisfied interfaces, struct embedding for composition, 'accept interfaces, return structs,' and defer for cleanup - plus a cheat-card of the gotchas that bite everyone once.
- Interfaces in Depth - Behavior, Not Hierarchy An interface value is secretly a (type, value) pair - and that one fact explains type assertions, type switches, the empty interface, and the infamous nil-interface trap that makes a nil error fail an `== nil` check.
- Generics & Advanced Types - One Function, Many Types Type parameters let one function or struct work across many types without losing type safety. Here's the problem generics solve, constraints and type sets, generic types, and the method-set rule that trips everyone up.
- Concurrency Patterns - From Goroutines to Real Systems Phase 6 gave you goroutines and channels. Here are the patterns real programs run on: select, context for cancellation, worker pools, fan-out/fan-in, the sync toolbox, and the race detector that finds bugs you can't read.
- Error Handling, Deep - Wrapping, Inspecting & Recovering Go past 'if err != nil': add context by wrapping with %w, inspect chains with errors.Is and errors.As, design sentinel and custom error types, and learn the one rule for when panic and recover are actually the right tool.
- The Runtime: Scheduler, Memory & GC - What Go Does for You What's underneath goroutines: why they're cheap, how the GMP scheduler multiplexes them onto threads, where values live (stack vs heap), what escape analysis decides, and how Go's concurrent GC keeps memory clean for you.
- Testing, Benchmarks & Profiling - Proving It Works and Finding the Slow Part Go deeper into Go's built-in testing toolchain: table-driven tests and subtests, benchmarks that measure ns/op and allocs/op, pprof profiling so you measure instead of guess, plus coverage and fuzzing.
- The Standard Library as Design - Small Interfaces, Big Reach Go's standard library is a masterclass in small composable interfaces - io.Reader/io.Writer let files, sockets, buffers, and gzip all plug together, plus a tour of context, encoding/json, and net/http.
- Performance & Optimization - Measure, Then Cut Allocations Performance work in Go is measurement first, algorithm second, allocations third. Find the real hot spot with benchmarks and pprof, fix the big-O, then cut heap churn - and know when good-enough is good enough.
- Where to Go Next Straight signposts for what to build with Go now - web services with net/http or chi/gin, CLIs with cobra, and Go's home turf of cloud and infrastructure tooling (Docker and Kubernetes are written in Go) - plus what to build next.