Fourteen articles typing go mod init like a ritual without explaining the spell. Today’s the day: what a module is, what go.mod and go.sum hold, and why Go modules are one of the few things in this world that just work. What a module is A module is a collection of packages versioned as a […]
READ MORE
Channels are the preferred road, not the only one. Today we complete the toolbox with the sync package for classic synchronization and context, the standard mechanism for telling an army of goroutines the show is over. Getting Go context right is half of production readiness. sync.WaitGroup: waiting without sleeping The official replacement for those time.Sleep […]
READ MORE
You’ve got goroutines and channels. Today we combine them into the three Go concurrency patterns that solve 90% of real concurrent problems. These are the same blueprints industry uses, documented on the official Go blog and in Rob Pike’s classic talk Go Concurrency Patterns. Pipeline: the assembly line A pipeline is a series of stages […]
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