Every dev landing in Go goes through the same two phases: first “am I seriously writing if err != nil every three lines?” and then, a few months later, “ok, now I get why”. This Go error handling article exists to shorten the trip between the two. Errors are values Go has no exceptions flying […]
READ MORE
The word pointer gives cold sweats to anyone who touched C in college, and puzzlement to anyone coming from Python or JS, where everything is a reference and nobody says so. Go pointers are the domesticated version: the power to choose, minus the arithmetic and the recreational segfaults. The mechanics: & and * Two operators, […]
READ MORE
Everything so far was the warm-up. Go concurrency is why the language exists and probably why you’re reading this series. And it starts with two letters: go. A goroutine is a function flying solo Put go in front of any call and that function runs concurrently, without blocking its launcher (A Tour of Go, goroutines): […]
READ MORE
Last article our goroutines flew solo and we waited for them with time.Sleep, which is like synchronizing watches by yelling out the window. Today the real tool arrives: Go channels, the typed pipes goroutines pass data through and, as a bonus, synchronize with. Channels: send, receive, block A channel is created with make and it’s […]
READ MORE