About 99 results
https://rednafi.com/go/di-frameworks-bleh/ · 24 May 2025
Dependency injection in Go doesn't need Dig or Wire. Learn why manual wiring beats reflection magic and how Go's design makes DI frameworks overkill.
https://matteogassend.com/articles/go-webapp-vite · 10 May 2025
import Callout from '../../components/mdx/Callout.astro' I've recently been playing around with Go (and RPC) and have stumbled upon the package, which allows us to specify files and directory to be embedded (hence the name) into the final binary. You wou...
https://rednafi.com/go/prevent-struct-copies/ · 21 Apr 2025
Prevent dangerous struct copies with noCopy sentinel and go vet's copylock checker. Protect mutexes and sync primitives from value copies.
https://rednafi.com/go/tool-directive/ · 13 Apr 2025
Pin tool versions in Go 1.24 with the new 'tool' directive. Replace tools.go pattern with native go.mod support for project tooling.
https://rednafi.com/go/capture-console-output/ · 12 Apr 2025
Test functions that write to stdout/stderr in Go by capturing output with os.Pipe. Learn patterns to avoid deadlocks in concurrent tests.
https://jakebailey.dev/posts/go-shadowing/ · 6 Apr 2025
The most common porting bug in the TypeScript Go port
https://rednafi.com/go/deferred-teardown-closure/ · 28 Mar 2025
Return teardown closures from test helpers to manage cleanup elegantly. Learn patterns for temp files, mock servers, and t.Cleanup() usage.
https://rednafi.com/go/sort-slice/ · 22 Mar 2025
Compare three Go slice sorting methods: sort.Interface, sort.Slice with closures, and modern generic slices.Sort with type safety.
https://rednafi.com/go/nil-interface-comparison/ · 12 Mar 2025
Debug tricky nil comparisons in Go interfaces. Understand dynamic types, type assertions, and use reflect for generic nil checking.
https://rednafi.com/go/middleware-vs-delegation/ · 6 Mar 2025
Compare middleware stacking with embedded delegation in Go HTTP servers. Learn when to override ServeHTTP for simpler request handling.