A hands-on path from zero to building real Go projects. Every folder is a runnable program — read the code, read the comments, run it, then tweak it and break it. That's how Go sticks.
Coming from Java? Watch for the // JAVA: comments throughout — they map each Go concept to what you already know.
Go is not installed on this machine yet. Install it:
# macOS (Homebrew)
brew install go
# or download the installer from https://go.dev/dl/
# verify
go version # should print go1.23 or newerThen from the repo root:
go run ./01-basics # run any topic folder like this
go test ./11-testing # run tests
go vet ./... # static checks across everything
gofmt -l . # list files that aren't formatted (should be empty)Tip:
go run ./01-basicsruns the whole package in that folder. Each numbered folder is an independentpackage mainwith its ownfunc main().
Work through these in order. Each builds on the last. Budget ~30–60 min per folder: read, run, then do the exercises at the bottom of each file.
| # | Topic | What you'll learn | Run it |
|---|---|---|---|
| 01 | Basics | variables, types, constants, zero values, :=, printing |
go run ./01-basics |
| 02 | Control flow | if, for (the only loop), switch, labels, defer |
go run ./02-control-flow |
| 03 | Functions | multiple returns, variadics, closures, defer/panic/recover |
go run ./03-functions |
| 04 | Collections | arrays vs slices, maps, strings, runes, range |
go run ./04-collections |
| 05 | Structs & methods | structs, methods, pointer vs value receivers, embedding | go run ./05-structs-methods |
| 06 | Interfaces | implicit interfaces, any, type assertions, type switches |
go run ./06-interfaces |
| 07 | Errors | error as a value, wrapping, errors.Is/As, custom errors |
go run ./07-errors |
| 08 | Concurrency ⭐ | goroutines, channels, select, sync, worker pools, context |
go run ./08-concurrency |
| 09 | Standard library | JSON, files, time, HTTP client |
go run ./09-stdlib |
| 10 | HTTP server | net/http, routing, handlers, middleware, JSON APIs |
go run ./10-http-server |
| 11 | Testing | testing, table-driven tests, benchmarks |
go test -v ./11-testing |
| 12 | Tooling & modules | go mod, packages, project layout, dependencies |
read the README |
⭐ = the chapter that matters most. Concurrency is the reason to learn Go and the biggest mental shift coming from Java's thread-per-request world.
Once you've finished 01–12, head to projects/. It has a
ladder of projects (each maps to a well-known Java tool) ordered easiest → hardest,
with milestones so you always know the next step.
Suggested first build: the worker-pool job queue — it forces you to actually use goroutines and channels, which is where Go's value lives.
- Run every file, don't just read it.
- Do the
// EXERCISE:blocks at the bottom of each file. They're small on purpose. - Break things. Change a value, remove a
gokeyword, swap a pointer receiver for a value receiver — see what the compiler says. Go's compiler is a great teacher. - Keep the Tour of Go and Effective Go open as references.
- After each chapter, write a 3-line summary in your own words.
Let's go.