typeover
curriculum
TS

GO

Curriculum

seven modules. Start anywhere — the recommended path is in order, but every theme is browsable. Themes without exercises yet are visible so you can see what's coming.

Progress saves per exercise — re-open any one to continue where you left off. Nothing leaves your browser.

7 modules complete · 0 partial · 0 scaffolded 31/31 themes authored (100%) 288 exercises
the wedge
variables.tsTS
let count: number = 5;
const PI = 3.14;

function double(n: number): number {
  return n * 2;
}
variables.goGO
count := 5
const PI = 3.14

func double(n int) int {
    return n * 2
}
Same intent, two syntaxes. typeover's whole shape is teaching the second one by leaning on what you already know about the first.

1. Foundations

6 themes · 58 exercises

The "you already know this, just spelled differently" module. By the end, you trust that typeover's translation pattern works, and writing trivial Go feels familiar.

TypeScript uses let and const to introduce variables; the type is inferred or annotated explicitly. Go has two short forms for the same job: - name := value — the **short de…

10 ready begin →

TypeScript has one number type. Go has many: int, int8, int16, int32, int64, uint* mirrors, float32, and float64. The big idea: **Go has no implicit numeric conve…

9 ready begin →

Go strings are immutable byte sequences. There are no template literals — fmt.Sprintf does the job. A byte is an alias for uint8; a rune is int32 and represents a Unicode…

10 ready begin →

if/else looks familiar — no parentheses, braces required. The one new shape is the short-statement-if: if err := work(); err != nil { ... }. It scopes a temporary to the…

10 ready begin →

Go has one loop keyword: for. Three shapes: - for i := 0; i < n; i++ { ... } — classic. - for cond { ... } — while-style. - for { ... } — infinite, exit via break or `ret…

9 ready begin →

Functions look familiar — func name(args) returnType { ... } — with one big new idea: multiple return values. Go functions can return a tuple, and the convention for "this mi…

10 ready begin →

2. Collections

3 themes · 32 exercises

Arrays, slices, maps, and the for-range loop. The translation pattern still works but the wrinkles deepen: slices are views, map iteration is unordered, and range gives you index+value.

Go has fixed-size arrays ([N]T) and dynamically-sized slices ([]T). You almost always want slices. A slice is a view over a backing array — three machine words: pointer…

11 ready begin →

2.2

Maps

map[K]V. Like a TS Record<K, V> or Map<K, V>. Lookup with comma-ok: v, ok := m[key]. Iteration order is undefined — every range yields a different ordering. Maps are re…

10 ready begin →

for i, v := range collection is the workhorse. Over a slice you get (index, value). Over a map you get (key, value). Over a string you get (byteIndex, rune). Over a channel…

11 ready begin →

3. Types & methods

4 themes · 36 exercises

The biggest mental-model change so far. TS object literals carry methods; Go structs don't. Methods are functions with a receiver. Pointers become explicit. Nil exists for a specific list of types.

type Foo struct { ... }. A struct is a typed record — fields and their types, nothing else. No methods on the struct itself (those come next). Field access with .. Struct liter…

9 ready begin →

Methods are functions with a receiver — a special argument declared before the function name: func (r Receiver) Foo() { ... }. Two flavours: value receivers (operate on a cop…

9 ready begin →

&x takes the address of x. *p dereferences p. Pointers in Go are pointers — they're not garbage-collector-hostile, they don't do arithmetic (no p++), and they don't bite.…

9 ready begin →

Every type has a zero value — what an uninitialised variable of that type holds. For numbers: 0. For strings: "". For bools: false. For pointers, interfaces, maps, slices,…

9 ready begin →

4. Interfaces & generics

2 themes · 18 exercises

Structural typing in Go's shape — implicit satisfaction with no implements keyword. Then generics on top: familiar from TS, mostly syntax to learn.

interface { Foo() }. A type implements an interface by having the right methods. There is no implements keyword. Satisfaction is implicit: if the methods match, the type sa…

9 ready begin →

Mostly familiar from TS. func Foo[T any](x T) T { ... }. The constraint syntax is where Go adds something new: an interface used as a constraint can list types or use ~T for "a…

9 ready begin →

5. Errors & packaging

5 themes · 45 exercises

Go's distinctive error convention — the (T, error) return shape, errors.Is and errors.As for inspection, and the rest of how Go programs are organised into packages and modules.

Go has no exceptions for ordinary control flow. Errors are values returned alongside results — (T, error). The caller checks err != nil and decides. This feels noisy at first;…

9 ready begin →

Inspecting errors without breaking the wrap chain. errors.Is(err, target) walks the wrap chain looking for a match against a sentinel. errors.As(err, &target) walks looking for…

9 ready begin →

v.(T) asserts that an interface value v is actually of type T. Panics if wrong. Use the comma-ok form to check first: if t, ok := v.(T); ok { ... }. For multi-branch checks…

9 ready begin →

Every file declares a package: package foo. Names starting with a capital letter are exported; lowercase are package-private. This rule is mechanical and pervasive; once you…

9 ready begin →

A module is a versioned collection of packages — your project's unit of dependency. go mod init github.com/you/yourthing produces go.mod. go get adds deps. Module paths look…

9 ready begin →

6. Concurrency

4 themes · 36 exercises

Native Go territory — no bilingual crutch. Goroutines, channels, select, and the sync primitives. Concurrency as a language-level feature, not a library bolt-on.

go fn() runs fn concurrently with the caller. That's it. No promises, no async/await, no event loop — the runtime multiplexes goroutines over OS threads. Cheap to start (ki…

9 ready begin →

Channels are typed pipes between goroutines. ch <- v sends, v := <-ch receives. Unbuffered channels are a synchronisation primitive: send blocks until receive completes. Buffer…

9 ready begin →

select waits on multiple channel operations and runs the case for whichever is ready first. With a default branch it becomes non-blocking. Paired with time.After(d) it become…

9 ready begin →

sync.Mutex, sync.RWMutex, sync.WaitGroup, sync.Once. The classical concurrency toolbox. Go's culture prefers channels for orchestration and sync for protecting state. Use…

9 ready begin →

7. Idioms & ecosystem

7 themes · 63 exercises

Graduating to "real Go" — defer, embedding, context, testing, the small-interface idiom, project layout, and the gotchas every Go programmer learns the hard way.

defer fn() schedules fn to run when the surrounding function returns. The closest TS analogue is a try/finally you don't have to indent. Multiple defers run LIFO. **Arguments…

9 ready begin →

Struct embedding gives you composition without inheritance. Embed a type as an unnamed field and its methods get promoted onto the outer struct. This is how Go does "extend a type"…

9 ready begin →

context.Context propagates cancellation, deadlines, and request-scoped values across goroutines and API boundaries. By convention, the first argument of any function that does I/…

9 ready begin →

Go has a testing package in the standard library. Tests live next to code in _test.go files. The pattern is table-driven: a slice of (name, input, want) tuples plus `t.Run(…

9 ready begin →

io.Reader { Read(p []byte) (n int, err error) }. One method. Go interfaces are typically tiny because implicit satisfaction rewards it — small interfaces are easy to satisfy acci…

9 ready begin →

cmd/<binary-name>/main.go per binary; internal/... for packages that should not be importable by other modules. Outside those two conventions, layout is up to you. The `golang-…

9 ready begin →

The "what bit me in code review" survival kit: - Loop variable capture (Go 1.22+ helped, but you should still know). - Nil interface vs nil concrete (a non-nil pointer inside an…

9 ready begin →

typeover · curriculum · pass 2

← back to home