TTuck
Go 1.27

A hands-on introduction to Go,
one annotated example at a time.

Each example is a complete program. The comments explain the code next to them, and the output underneath is what the program really prints. Start at the top for the language basics, or jump to the part of the standard library you need.

Examples
91
Topics
16
Standard library packages
49
Lines of Go
6,178

Basics01–07

Collections08–11

Functions12–16

Types and methods17–24

Generics and iterators25–26

Errors27–31

Concurrency32–51

Sorting52–53

Text54–57

Encoding58–63

Time and numbers64–68

Files and I/O69–76

Command line77–81

Networking82–84

Processes and signals85–88

Testing and packages89–91