This guide teaches Go fundamentals and the Bubble Tea TUI framework using the rig codebase as a living example. Every concept is illustrated with real code from this repo.
- Go Fundamentals — entry points, value types, zero values, modules, packages, and imports
- Types, Functions, and Error Handling — structs, interfaces, receivers, closures, slices,
init(), and concurrency
- The Elm Architecture — the Model-Update-View loop and the
tea.Modelinterface - Messages and Commands — how events flow and async work is triggered
- Composing Models — parent-child delegation, the standalone wrapper, and embedded components
- Async Operations — the startAsync pattern, bubbles spinner/stopwatch components, and the error splash overlay
- Styling and CLI — Lipgloss terminal styling and Cobra CLI routing
- Testing — test conventions, table-driven tests, and testing Bubble Tea models
- Gotchas — value semantics bugs, closure capture, nil slices, and other pitfalls
- Adding a New Tool — step-by-step recipe that ties all the concepts together
- A Tour of Go — official interactive tutorial
- Effective Go — idiomatic Go patterns
- Bubble Tea docs — framework docs and examples
- Lipgloss docs — styling reference
- Cobra docs — CLI framework
- Go by Example — concise examples of Go features