{} The Go Reference

Batteries included

The Standard Library & Tooling

Go ships with a famously capable standard library and toolchain — so most days you write less code, not more. From fmt and the io interfaces to encoding/json, files, the CLI and structured logging, then the testing, benchmarking and profiling tools that come in the box.

Your stdlib progress

Mark a topic “learned” on its page and watch the bars fill.

Skill map

Learned nodes light up — the glowing one is your next step. Click any node to jump in.

Core Packages

The packages you reach for daily — fmt and the io interfaces, strings and bytes, encoding/json, and working with time.

1 · Start here fmt & io

Formatting and streaming — the fmt verbs you'll actually use, width/precision flags, the Stringer/Formatter hooks, and the tiny io.Reader/io.Writer interfaces (plus io.Copy, MultiWriter, TeeReader) that everything plugs into.

✦ Complete · ⏱ 9 min
2 · Beginner strings & bytes

The text toolkit — searching and transforming with the strings package, O(n) assembly via strings.Builder, the parallel bytes package and bytes.Buffer, strconv for number⇄string conversion, and the unicode/utf8 view of multibyte text.

✦ Complete · ⏱ 7 min
2.5 · Beginner regexp

Pattern matching in Go — compile once with MustCompile, match/find/replace, capture groups (named and numbered), the linear-time RE2 engine and what it deliberately can't do (no backreferences), and when plain strings functions are the better tool.

✦ Complete · ⏱ 5 min
3 · Beginner encoding/json

Turning Go values into JSON and back — Marshal/Unmarshal, struct tags and omitempty, decoding into structs vs maps, streaming Encoder/Decoder, custom Marshaler/Unmarshaler, and json.RawMessage for deferred decoding.

✦ Complete · ⏱ 7 min
3.5 · Intermediate text/template & html/template

Data-driven text generation — actions, fields and pipelines, if/range/with control flow, custom funcs, and why html/template's context-aware auto-escaping is the one you must use for the web.

✦ Complete · ⏱ 6 min
4 · Beginner time

Instants, durations and the famous reference layout — formatting and parsing, time arithmetic and zones, the monotonic clock, measuring elapsed time, and timers vs tickers (and how to stop them).

✦ Complete · ⏱ 5 min

Files, CLI & Logging

Talking to the outside world — reading and writing files with os, building command-line tools with flag, and structured logging with slog.

Testing

Go's batteries-included testing — the testing package, table-driven tests and subtests, fuzzing, and benchmarks.

Tooling & Profiling

The toolchain that ships with Go — the go command and modules, profiling with pprof, and catching data races with the race detector.

🐹 Read the standard library

The stdlib is small, consistent and beautifully written — and its source is some of the best Go you can learn from. When an interface feels right (io.Reader, http.Handler), it's usually because the standard library set the example. Prefer it before reaching for a dependency.