Golang
Advanced Go Concurrency Patterns
Master goroutines, channels, and concurrency patterns for building high-performance Go applications
Go’s concurrency model is one of its most powerful features. This guide explores goroutines, channels, and advanced patterns for writing efficient concurrent code.
3 Ways to Add a --version Flag to a Go CLI
Inject build metadata with -ldflags, read it back with debug.ReadBuildInfo, or grab a tiny helper package — three approaches to a --version flag, with the trade-offs of each
Every CLI eventually grows a --version flag. Users need it to file useful bug reports, scripts need it to gate behavior, and you need it when an issue lands and you want to know what binary the reporter is actually running. Go gives you a few ways to wire this up — none of them long, but each with different ergonomics. Here are the three I reach for.
My Claude Code Setup, From Zero
Installing Claude Code and wiring it up the way I actually use it: CodeGraph for code intelligence, MCP servers, plugin marketplaces, LSP, GitHub Spec Kit, and Herdr to keep the agents running.
A fresh Claude Code install is useful. A configured one is a different tool entirely. The gap between the two is maybe fifteen minutes of setup — a code index, a handful of MCP servers, two plugin marketplaces, a spec workflow, and a runtime to keep it all alive — and I keep re-doing it every time I move to a new machine. So here it is written down, in the order I run it.
A Guide to Upgrading Your Library to a Major Release in Go
Practical walkthrough of bumping a Go module to v2+: import paths, branches, tags, and what not to forget.
Bumping a Go library to a new major version is not just a git tag v2.0.0. Go’s Semantic Import Versioning makes the module path itself part of the version contract — so v2+ means rewriting go.mod, every internal import, and (often) reorganizing branches. This is the short, command-driven version of the official guide, with the operational steps that are easy to forget.
auto-mr: one command from feature branch to merged PR
A Go CLI that pushes your branch, opens an MR/PR, waits for CI, and merges — works on both GitLab and GitHub
I push a feature branch a dozen times a week. Every single time, the dance is the same: git push, switch to the browser, click the “Create MR” button, set assignee, set reviewer, add labels, wait for CI, click merge, switch back to terminal, git checkout main, git pull, git branch -d feature/.... It’s not hard. It’s just tedious — and the kind of friction that adds up over a week.
I had a shell script glued together with glab, gh, jq, yq, and gum doing this for years. It worked, but it broke whenever any of those tools updated and was a pain to ship to a fresh laptop. So I rewrote the whole thing in Go and called it auto-mr. One binary, no external CLIs, works on both GitLab and GitHub.