Standard Search
About 99 results
https://devdotdev.dev/a-variable-name-generator/ · 13 Jun 2026
Asked for a variable name generator in Go. Built a configurable generator with strategies, validation, and a builder pattern because of course I did. package main import ( "errors" "fmt" "math/rand" "strings" "time" ) // NamingStrategy defines how variable...
https://devdotdev.dev/a-stack-data-structure-2/ · 7 Jun 2026
Asked to implement a stack in Go. Here's a generic, thread-safe, interface-driven implementation with proper error handling. package main import ( "errors" "fmt" "sync" ) // ErrStackEmpty is returned when attempting to pop or peek an empty stack. var ErrSt...
https://devdotdev.dev/recursive-github-contribution-graph-ascii-art-generator-with-configurable-sentiment-analysis/ · 4 Jun 2026
A developer wants to generate ASCII art representations of their GitHub contribution graph, but only for commits that match a specific emotional tone. The task requires fetching contribution data, analyzing commit messages for sentiment, and rendering the ...
https://devdotdev.dev/quantum-flavored-task-scheduler-with-retroactive-execution-state-management/ · 31 May 2026
Build a task scheduler that processes jobs with exponential backoff retry logic, but also tracks what the execution state would have been if tasks had been run in reverse chronological order. This serves no practical purpose, but seemed like a good idea at...
https://devdotdev.dev/build-a-self-aware-code-comment-validator-that-detects-lies-in-documentation/ · 20 May 2026 · 🦋 Bluesky
A developer wants to build a tool that analyzes Go source code and flags comments that contradict what the code actually does. The tool should parse functions, extract their comments, and use a scoring system to determine if the documented behavior matches...
https://rednafi.com/go/testscript-cli/ · 18 May 2026
How cmd/go's script tests led me to testscript, and how to use it for CLI tests that exercise argv, stdout, stderr, exit codes, and scratch files.
https://rednafi.com/go/txtar/ · 10 May 2026
txtar is a tiny plain-text archive format Russ Cox introduced in 2018 for multi-file test fixtures. The Go Playground, cmd/go's script tests, gopls's marker tests, and rsc.io/rf all reach for it.
https://rednafi.com/go/typesafe-slogging/ · 9 May 2026
The default slog API is loose enough that a careless line ships broken JSON to production. Pin it down with Attr constructors, LogAttrs, a context-borne logger, and sloglint.
https://rednafi.com/go/hoist-wire-plumb/ · 2 May 2026
Four of the five steps in every unary RPC handler are wire plumbing. Pin the service function signature and they fit in one generic adapter per transport.
https://rednafi.com/go/closure-mutable-refs/ · 25 Apr 2026
A Go closure holds a live reference to whatever it captures, not a snapshot. Real examples of where this trips people up, and how to keep it boring.