7 days · 20 concepts
Go / Concepts

Go in a week

Twenty concept pages, grouped into seven days. Each page builds intuition first — what is this, why does it exist, what does it feel like to use — then shows a small Go program you can paste into the playground. Skim the day; pick the concept you're shaky on; finish the week with running code, not memorised syntax.

Intuition first · sample code throughout · paste-and-run


The seven-day plan

Not a strict schedule — a sequence. Each day's concepts compose into the next. On day 5 you'll write a goroutine that sends on a channel; that requires day 4's interfaces, day 3's errors, day 2's slices, day 1's functions. Don't skip ahead.

Day 1 · First contact

The toolchain, the type system, functions. Two hours and you can read Go.

  1. 01

    Hello, Go

    The toolchain in 5 minutes. Run, build, format, fix.

  2. 02

    Variables, types, constants

    Static typing without ceremony. Inference does most of the work.

  3. 03

    Functions

    Multiple returns, named results, first-class. The Go function feels different.

Day 2 · Data shapes

Slices, maps, structs. Three structures that cover 80% of real Go code.

  1. 04

    Slices

    A view over an array. Once you grok cap vs. len, the rest of Go opens up.

  2. 05

    Maps

    The hash map, blessed as a built-in. With one surprise behaviour.

  3. 06

    Structs & methods

    No classes. Structs hold data; methods attach to types — including int.

Day 3 · Flow & errors

Loops, errors, pointers. The "if err != nil" thing demystified.

  1. 07

    Control flow

    One loop, no parentheses, defer is the surprise. switch is a power tool.

  2. 08

    Errors

    No exceptions. Errors are values. The "if err != nil" thing.

  3. 09

    Pointers

    Real pointers, no pointer arithmetic. When to use them and when not.

Day 4 · Polymorphism, the Go way

Interfaces and generics. Where Go differs from every other language.

  1. 10

    Interfaces

    The secret sauce. Structural typing — "if it walks like a duck".

  2. 11

    Generics

    Type parameters since 1.18. When they help and when interfaces still win.

Day 5 · Concurrency primer

Goroutines and channels. The headline feature.

  1. 12

    Goroutines

    Threads, but tiny. 2KB stacks that grow. Spawn 100k without thinking.

  2. 13

    Channels

    Communicate by sharing memory? No. Share memory by communicating.

  3. 14

    select, sync, context

    select multiplexes channels. sync.Mutex for when channels do not fit. context for cancellation.

Day 6 · The standard library tour

io.Reader, io.Writer, net/http. The standard library does a lot.

  1. 15

    Strings & runes

    Strings are bytes. Runes are code points. The difference matters.

  2. 16

    io.Reader and io.Writer

    Two interfaces underpin everything. Master them once.

  3. 17

    net/http

    A full HTTP server in five lines. The middleware pattern is just functions.

Day 7 · Idiomatic Go

Modules, tests, idioms. From "Go compiles" to "Go that ships".

  1. 18

    Modules & packages

    go mod, package layout, imports. The 2024 idiom.

  2. 19

    Testing & benchmarks

    No framework needed. Table-driven tests are the Go style.

  3. 20

    Idiomatic Go

    The "go is simple" claim is the discipline. Twenty patterns that separate competent from idiomatic.

How each concept page works

Same shape every page. Designed for paste-and-run learning, not video binge.

  1. Intuition. The mental model in three sentences. Why this concept exists, what it feels like to use, where it fits.
  2. Try it. A small program — typically 10-20 lines — that you can paste into the Go playground and run. Annotated comments throughout.
  3. Build it up. Two or three variations on the program that expose the concept's edges. The "oh, that's what's happening" moments.
  4. Common mistakes. Three to five bugs that catch every newcomer. Each as a snippet with the fix.
  5. When it clicks. The signal that you've internalised the concept. The next page is the next concept.

Set up before day 1

  • Install Go. Visit go.dev/dl. Pick your platform. The installer adds go to your $PATH.
  • Verify. Open a terminal. Run go version. Expect go version go1.22.x or newer.
  • Or use the playground. Every code sample on these pages runs in go.dev/play without installing anything.
  • Editor. VS Code with the official Go extension is the no-friction default. GoLand from JetBrains is the paid option.
  • What you don't need. No build system. No package manager beyond go mod (built in). No frameworks.

What "fluent in a week" actually means

At the end of seven focused days, you should be able to:

  • Read any Go program and roughly understand what it does on first scan.
  • Write a small HTTP server in 30 lines without looking anything up.
  • Use slices, maps, and structs without re-reading the docs.
  • Spawn a goroutine, send on a channel, and not be afraid of the result.
  • Handle errors idiomatically — checking, wrapping, returning early.
  • Write a table-driven test for any function you write.

Not mastery. Mastery comes from shipping things. Fluency means the syntax is invisible — you're thinking about the problem, not the language. That's the goal of seven days.

What this path doesn't cover

Three things are deliberately out of scope here. Each lives in its own corner of the site.

  • The runtime internals. Goroutines as concept are here; the M:P:G scheduler, escape analysis, the GC — that's /codex/languages/go/internals/, ten deep dives that you should read after you can write Go fluently.
  • Production patterns. Wiring an HTTP server with middleware, structured logging, observability, dependency injection — that's the design-pattern follow-up, not the language tour.
  • Specific frameworks. Gin, Fiber, Echo, gRPC. These are not Go — they're libraries written in Go. Once the language is fluent, the framework picks are minutes, not days.