Go 1.23 added "range over func" — your own functions can produce values that work with `for v := range fn`. Cleaner than channels for in-process iteration without goroutine overhead.
`encoding/json` is the standard library JSON parser. `Marshal` produces compact JSON; `MarshalIndent` produces pretty-printed. `Unmarshal` decodes into a typed value (struct, map, or any).
`github.com/google/uuid` is the standard UUID library. v4 (random) for IDs, v7 (time-ordered) when you want UUIDs that sort chronologically and play nicely with B-tree indexes.
`encoding/base64` has Standard, URL-safe, and Raw (no padding) variants. URL-safe replaces `+/` with `-_` so the output is safe in query strings and filenames.
`//go:build` constraints control which files compile under which conditions — different code for Linux vs Windows, dev vs prod, with/without a feature. Standard library uses this heavily.
Stdlib templating with `{{.Field}}` placeholders, range loops, if/else, and function pipelines. Safe alternative for non-HTML text (e.g. emails, config files).
Middleware in Go is `func(http.Handler) http.Handler`. Wrap a handler with logging, auth, recovery, CORS, or rate limiting — chain them together for a real middleware stack.
The standard library ships a production-quality HTTP server. `http.HandleFunc` registers a function; `http.ListenAndServe` blocks forever serving requests.
Go's time formatting uses a reference date instead of strftime tokens: `Mon Jan 2 15:04:05 MST 2006` (which is 01/02 03:04:05PM '06 -0700, or 1/2/3/4/5/6/7 — mnemonic). Strange at first, instantly memorable.
A pipeline is a chain of stages connected by channels — each stage runs in its own goroutine. Classic Go pattern for streaming transformations with backpressure built in.
Stop concatenating `?a=1&b=2` by hand. `url.Values` (a `map[string][]string`) escapes correctly, handles repeated keys, and `url.URL.String()` renders the canonical form.
`Mutex` allows one goroutine at a time — for both reads and writes. `RWMutex` allows multiple concurrent readers OR one writer — much better when reads dominate.
`log/slog` (Go 1.21+) is the standard structured logger. Drop-in replacement for `log` with key/value attributes and JSON output for log-pipeline ingestion.
When you extract a verification routine into a helper, call `t.Helper()` so failure messages point to the CALLER line — not the helper line. One line, much better diagnostics.