Skip to content

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 ​

BadgeMeaning
Must-knowasked in almost every interview; you meet it at work constantly
Importantfrequent; expected at senior level
Good to knowextra depth that sets you apart
WIP / Todoshown 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 ​

ChapterLevelWhat you learn
Toolchain, Modules & PackagesMust-knowA 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-knowEvery 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 FlowMust-knowGo 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…
FunctionsMust-knowA 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 & DeferMust-knowIn 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 BasicsMust-knowA 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 ​

ChapterLevelWhat you learn
Arrays, Slices & MapsMust-knowGo 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-knowA 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 & anyMust-knowAn 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…
GenericsImportantGo 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…ImportantA 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…ImportantA 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 ​

ChapterLevelWhat you learn
Files, Directories, Paths, Temp Files, bufio…ImportantFiles 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 PackageMust-knowio.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, Base64Must-knowencoding/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 & CryptoImportantGo'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…ImportantA 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 ShutdownImportantA 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…
reflectGood to knowreflect lets a Go program inspect and change values whose type it did not know when it was compiled.
cgo & Plugins TodoGood to knowto be written.

Concurrency ​

ChapterLevelWhat you learn
Goroutines & ChannelsMust-knowA 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…
selectMust-knowselect 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.
contextMust-knowcontext.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 & atomicMust-knowThe 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-knowA 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-knowA 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 GoImportantA 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 ​

ChapterLevelWhat you learn
Testing & BenchmarkingMust-knowGo 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-knowTestable 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…Importanta 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 TodoImportantto be written.

HTTP & APIs ​

ChapterLevelWhat you learn
net/httpMust-knownet/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…
MiddlewaresMust-knowIn 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 GoMust-knowOne 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 GoMust-knowAuthentication 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/templateGood to knowhtml/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…ImportantIn 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 GoImportantIn 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 gqlgenGood to knowGraphQL 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 TodoGood to knowto be written.
Web Frameworks & ORMs in Go TodoGood to knowto be written.

Data & Messaging in Go ​

ChapterLevelWhat you learn
database/sql & pgxMust-knowHow 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 GoGood to knowthe 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 GoImportantAn 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 CDNImportantAn upload is untrusted bytes plus untrusted metadata (name, type, size) that you must bound, check, rename and park in object storage…

Projects ​

ChapterLevelWhat you learn
ProjectImportantA 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…
ProjectImportantOne 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…
ProjectGood to knowAn 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.
ProjectGood to knowA 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…

Built by Morteza Negahi