Go — learning path
The language from values to generics, then I/O and encoding, concurrency in depth, testing, HTTP and APIs (REST, gRPC, GraphQL, auth), data and messaging, and four end-to-end projects (microservices, e-commerce API, MCP server, RAG app). Chapters are Go-only; where a PHP/Laravel comparison clarifies, it is included.
Legend
| Badge | Meaning |
|---|---|
| Must-know | asked in almost every interview; you meet it at work constantly |
| Important | frequent; expected at senior level |
| Good to know | extra depth that sets you apart |
| WIP / Todo | shown next to a chapter only while it is still being written |
How to read this page. Groups are in reading order and each one builds on the previous; short on time, take the Must-know chapters of every group first. The last column says in one line what the chapter gives you. Every chapter ends with a Self-check: questions & answers block (open/close all, filter by level); all questions are collected in the Interview Q&A hub.
Chapters
49 chapters · 45 complete · 4 not written yet
Language Fundamentals
| Chapter | Level | What you learn |
|---|---|---|
| Toolchain, Modules & Packages | Must-know | A Go program is a tree of packages inside a module; the go command resolves the module graph with minimal version selection, verifies it with go.sum, compiles it with a toolchain your go.mod can pin… |
| Values, Variables, Constants, iota Enums & Ze… | Must-know | Every Go value has a static type and a zero value; constants are exact, untyped numbers that only become a typed value when they meet a variable, which is why iota enums… |
| Control Flow | Must-know | Go has three control structures, if, switch and for (plus select and goto), and each is smaller than its C or PHP cousin: no parentheses, no while, no implicit fall-through… |
| Functions | Must-know | A Go function is a value with a type; every argument is copied, a function can return several results, and a function literal that mentions an outer variable carries that variable with it. |
| Errors, Wrapping, Panic, Recover & Defer | Must-know | In Go a failure is an ordinary value of the error interface that you return, wrap with context and inspect with errors.Is/errors.As; panic is for bugs and impossible states… |
| Pointers & Memory Model Basics | Must-know | A Go pointer is a typed address you can copy, compare and dereference but never add to; the compiler decides whether the value lives on the stack or the heap… |
Types & Data
| Chapter | Level | What you learn |
|---|---|---|
| Arrays, Slices & Maps | Must-know | Go has one fixed-size value type (the array), one view type on top of it (the slice: pointer, length, capacity) and one built-in hash table (the map)… |
| Structs, Methods, Constructors, Embedding & S… | Must-know | A struct is a fixed sequence of typed fields; methods attach behaviour to any named type through a value or pointer receiver… |
| Interfaces, Type Assertions, Type Switches & any | Must-know | An interface is a set of methods; any type whose method set contains them satisfies it without saying so, and an interface value is a two-word pair (type… |
| Generics | Important | Go generics let one function or type work for a set of types: type parameters in square brackets, constraints that are interfaces read as type sets, inference that usually spares you the type arguments… |
| Strings, Runes, fmt Verbs, text/template & re… | Important | A Go string is an immutable sequence of bytes that is usually UTF-8; len counts bytes, range decodes runes, and everything else (formatting, templates, regular expressions… |
| time.Time, Formatting/Parsing, Time Zones, Ti… | Important | A time.Time is an instant with two clock readings and a location, a Duration is a count of nanoseconds, layouts are written with one magic reference date, time zones come from the IANA database… |
I/O & Encoding
| Chapter | Level | What you learn |
|---|---|---|
| Files, Directories, Paths, Temp Files, bufio… | Important | Files in Go are *os.File values wrapped around a file descriptor, directories and paths are plain strings and fs.FS values, and almost every real bug lives in the gaps: an unchecked Close… |
| The io Package | Must-know | io.Reader and io.Writer are two one-method interfaces that every byte source and sink in Go implements (files, sockets, HTTP bodies, gzip, hashes, buffers)… |
| JSON, XML, Struct Tags, Encoder/Decoder, Base64 | Must-know | encoding/json maps Go values to JSON text with reflection and struct tags; the sharp edges are tag semantics, float64 numbers, null versus absent, unknown fields, duplicate keys and unbounded input. |
| Hashing & Crypto | Important | Go's crypto/* packages give you hashes, MACs, password hashes, key derivation, random bytes, authenticated encryption, signatures and key agreement with small, hard-to-misuse APIs… |
| CLI Flags, Subcommands, Environment Variables… | Important | A Go program talks to its operator through four channels: arguments (flags and subcommands), the environment, standard streams with an exit code, and logs… |
| OS Processes, Signals & Graceful Shutdown | Important | A Go service is one operating-system process that other processes talk to with exit codes, pipes and signals; this chapter covers starting children safely with os/exec, receiving signals with os/signal… |
| reflect | Good to know | reflect lets a Go program inspect and change values whose type it did not know when it was compiled. |
| cgo & Plugins Todo | Good to know | to be written. |
Concurrency
| Chapter | Level | What you learn |
|---|---|---|
| Goroutines & Channels | Must-know | A goroutine is a function running concurrently in the same address space, scheduled by the Go runtime onto a few OS threads; a channel is a typed, synchronised FIFO that lets goroutines hand values… |
| select | Must-know | select waits on several channel operations at once and runs exactly one: a random one among those that are ready, the default case if none is ready, or it blocks until one becomes ready. |
| context | Must-know | context.Context is how one Go request tells all the work done on its behalf to stop: it carries a cancellation signal, an optional deadline and a few request-scoped values down the call chain… |
| sync & atomic | Must-know | The sync and sync/atomic packages give goroutines that share memory a small set of tools: locks (Mutex, RWMutex), lifecycle helpers (WaitGroup, Once), a condition variable (Cond)… |
| Worker Pools, Pipelines, Fan-Out/Fan-In, errg… | Must-know | A worker pool is a fixed number of goroutines reading a jobs channel and writing a results channel; a pipeline is a chain of such stages… |
| Race Conditions, the Race Detector, Deadlocks… | Must-know | A data race is two unsynchronised accesses to the same memory, at least one a write; in Go it is a bug with no defined result for multi-word values. |
| Rate Limiting in Go | Important | A rate limiter answers one question, "may this event happen now?", with a small piece of state per caller; in Go the token bucket in golang.org/x/time/rate is the default answer, and every other algorithm… |
Testing & Quality
| Chapter | Level | What you learn |
|---|---|---|
| Testing & Benchmarking | Must-know | Go ships its test framework in the toolchain: go test finds TestXxx, BenchmarkXxx, FuzzXxx and ExampleXxx functions in _test.go files, builds one test binary per package, runs a vet subset first… |
| Mocking with Interfaces, Dependency Injection… | Must-know | Testable Go code receives its collaborators (a store, a payment gateway, the clock, an io.Reader) through its constructor as small interfaces that the consuming package declares, so a test can hand in a stub… |
| Project Layout, golangci-lint, Makefile, Dock… | Important | a Go project is a module (one go.mod) holding packages; where you put directories decides what can be imported, what can be built into separate binaries and what a linter or a Dockerfile has to know. |
| Profiling & Debugging Todo | Important | to be written. |
HTTP & APIs
| Chapter | Level | What you learn |
|---|---|---|
| net/http | Must-know | net/http is a production HTTP server and client in the standard library: a Handler interface, a ServeMux router that matches hosts (always has) and, since Go 1.22, methods and path wildcards… |
| Middlewares | Must-know | In Go a middleware is a function of type func(http.Handler) http.Handler: it wraps the next handler, runs code before and after it, and may answer on its own. |
| A REST API in Go | Must-know | One complete, production-shaped JSON API in plain Go: plan the resources and URLs first, then build handlers that decode bounded DTOs, validate them, call a service layer that owns a repository interface… |
| Authentication in Go | Must-know | Authentication in a Go service is a chain of small, separately testable pieces: a slow salted password hash (Argon2id or bcrypt) checked in constant time… |
| html/template | Good to know | html/template turns Go values into HTML that cannot be hijacked by the data: it reads the template as HTML, CSS, JavaScript and URLs, and picks the right encoder for every action. |
| HTTP/2, HTTPS, TLS & mTLS in Go; Benchmarking… | Important | In Go, HTTPS is crypto/tls plus net/http: a tls.Config decides which certificates, versions, key exchanges and client-certificate policy a connection uses… |
| gRPC & Protobuf in Go | Important | In Go, gRPC is three things you assemble yourself: a .proto contract compiled by buf (or protoc) with protoc-gen-go and protoc-gen-go-grpc into typed messages, a client stub and a server interface… |
| GraphQL in Go with gqlgen | Good to know | GraphQL gives clients one typed endpoint where they ask for exactly the fields they need; in Go, gqlgen turns your SDL schema into an executable schema plus resolver stubs… |
| WebSockets & Realtime in Go Todo | Good to know | to be written. |
| Web Frameworks & ORMs in Go Todo | Good to know | to be written. |
Data & Messaging in Go
| Chapter | Level | What you learn |
|---|---|---|
| database/sql & pgx | Must-know | How a Go service talks to PostgreSQL correctly: database/sql and its pool, drivers (pgx stdlib, lib/pq, go-sql-driver/mysql), queries and scanning, NULLs, placeholders… |
| MongoDB with Go | Good to know | the official mongo-go-driver v2 (go.mongodb.org/mongo-driver/v2) turns Go structs into BSON documents and back, runs CRUD, filters, updates, indexes, aggregation, transactions and change streams… |
| Event-Driven Go | Important | An event-driven Go service talks to its neighbours through a broker instead of calling them: it publishes facts, consumes messages with handlers that can safely run twice… |
| File Uploads, S3 & Serving from a CDN | Important | An upload is untrusted bytes plus untrusted metadata (name, type, size) that you must bound, check, rename and park in object storage… |
Projects
| Chapter | Level | What you learn |
|---|---|---|
| Project | Important | A complete project walkthrough of five small Go services: a broker service that is the only front door, an authentication service on Postgres with bcrypt, a logger service on MongoDB reachable over REST… |
| Project | Important | One complete shop backend in Go: a catalogue with keyset pagination and search, a server-side cart that survives login, a checkout that in one PostgreSQL transaction reserves stock… |
| Project | Good to know | An MCP server is a small program that offers tools, resources and prompts to an AI host such as Claude Desktop, Claude Code or Cursor over JSON-RPC 2.0. |
| Project | Good to know | A retrieval-augmented (RAG) application is an ordinary Go web service with two paths: an ingestion pipeline that turns documents into embedded chunks in PostgreSQL with pgvector… |