Posts
Go Basics: Wait for Concurrent Work Before Reading Results
Use sync.WaitGroup to coordinate independent workers and print results in input order.
October 31, 2026
Go Basics: Understand Deferred Calls Before Using Cleanup
Observe when defer captures arguments, when closures read variables, and why cleanup order reverses.
October 31, 2026
Go Basics: Stop a Worker with Context Cancellation
Cancel a context, wait for a worker acknowledgment, and inspect the cancellation cause.
October 31, 2026
Go Basics: Share One Lazily Computed Value
Use sync.OnceValue to initialize shared data once across concurrent callers.
October 31, 2026
Go Basics: Set Explicit Limits for Line-Oriented Input
Configure bufio.Scanner for bounded lines and check its terminal error.
October 31, 2026
Go Basics: Reject Extra JSON Values in Configuration
Combine unknown-field rejection with an end-of-input check for one JSON configuration object.
October 31, 2026
Go Basics: Preserve Error Identity Through Context
Wrap a sentinel error with %w and inspect typed parsing errors with errors.As.
October 31, 2026
Go Basics: Pass Subprocess Arguments Without a Shell
Run a Linux executable with os/exec, preserve argument boundaries, and classify a nonzero exit.
October 31, 2026
Go Basics: Parse Timestamps and Durations Explicitly
Parse RFC3339 timestamps, normalize to UTC, and keep elapsed durations separate from calendar dates.
October 31, 2026
Go Basics: Parse CSV Records Without Splitting on Commas
Read quoted CSV fields, enforce a fixed column count, and classify malformed records.
October 31, 2026