01 — multiple returns
Errors are values, returned, not thrown — if err != nil is the lifestyle.
func parse(s string) (int, error) {
n, err := strconv.Atoi(s)
return n, err
}← the guideMulticore & Missions
§ 02 — Eras · 2009
boring by design — fast builds, safe concurrency
Left: era context, features, and the 101 hello. Right: 3 core concepts, 3 deeper 201 lessons, the factorial specimen, and where Go lives today — each column scrolls on its own.
Google’s builds were slow and its concurrency error-prone. Go bet everything on simplicity, speed, and CSP channels.
Simplicity enforced: no generics for thirteen years, if err != nil as a lifestyle, and runtime magic under a plain exterior.
Session one is the smallest program that still counts as speaking Go: what every tutorial prints first, in the dialect that mattered when the language arrived (2009).
package main
import "fmt"
func main() {
fmt.Println("Hello, world")
}101First contact — hello world and 3 ideas that define how Go reads. 201 — 3 lessons on mechanisms you meet after the factorial specimen: the sharp edges practitioners actually use.
3 fragments, each naming a habit of mind in Go. Read the note, then the code — together they are the 101 in one sitting.
01 — multiple returns
Errors are values, returned, not thrown — if err != nil is the lifestyle.
func parse(s string) (int, error) {
n, err := strconv.Atoi(s)
return n, err
}02 — structs & methods
No classes: data plus methods, composition over inheritance.
type Ship struct{ Tons int }
func (s Ship) Heavy() bool {
return s.Tons > 20
}03 — goroutines & channels
Hoare’s CSP as syntax: start a goroutine with go, meet on a typed channel.
ch := make(chan string)
go func() { ch <- "done" }()
fmt.Println(<-ch)The 201 assumes you have read the 101 and the specimen. Each lesson is one mechanism — what it is for, how it looks in code, and the trap or payoff that makes Go distinctive at scale.
Wrapping preserves the cause and adds context; errors.Is and errors.As let callers check for a specific failure deep in the chain.
if err != nil {
return fmt.Errorf("load crew %s: %w", id, err)
}A context carries deadlines and cancellation down the call tree, so a request that is abandoned stops the work it started.
ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
defer cancel()
result, err := fetch(ctx, url)Worker pools, errgroup and sync primitives — the practical patterns that Go’s goroutines and channels are meant to express.
g, ctx := errgroup.WithContext(ctx)
for _, url := range urls {
url := url
g.Go(func() error { return fetch(ctx, url) })
}
err := g.Wait()The channel: goroutines meet on typed pipes — Hoare’s CSP made ordinary, concurrency made a primitive.
ch := make(chan string)
go func() { ch <- "done" }()
fmt.Println(<-ch)installbrew install go
rungo run fact.go
The cloud runs on it: Docker, Kubernetes, Terraform, most CNCF projects — everywhere ops meets code.