Go Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

A single-page, colour-coded summary of the Go language and its toolchain, written against Go 1.27 (go1.27.2; checked 2026-10-18) — the go command map and a go.mod skeleton with toolchain, tool, godebug and ignore, packages, imports and initialization order, the table of basic types with zero values, literals and constants with iota, declarations and operators, control flow with every for form, range over integers and functions and the Go 1.22 loop-variable rule, functions with defer, panic and recover, slices, maps, strings and the builtins, structs, embedding and tags, methods with the method-set table, interfaces and the nil-interface pitfall, generics (including Go 1.27 generic methods) and iterators, errors with %w, Is, As, AsType and Join, goroutines, the channel axioms table, select, context, sync and atomics, testing with b.Loop, fuzzing and testing/synctest, standard-library one-liners, build constraints, directives and cross-compilation, diagnostics with pprof and PGO, reflection, unsafe, cgo and WebAssembly, and a strip of what changed since older tutorials — handy for quick memorization or as a downloadable PDF desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Start here — Go Reference.

References

The PDF summarizes the official documentation; each source is cited in full on the page listed above that covers it, and in the section bibliography.