Blog
The Day the Linter Broke My Code
Monday, September 15, 2025 in Blog
Series:
Another Story… Imagine you were given a task to design errors for your service. DataEOFError should contain the name of the data file and be considered equal to io.ErrUnexpectedEOF. ProcessingFailedError should contain a processing ID as a string and …
Understanding Go Error Types: Pointer vs. Value
Wednesday, August 13, 2025 in Blog
Series:
A Small Story… Imagine you have to rewrite cluster autoscaling. There’s a function makeNodeSchedulable that rarely returns a CriticalAddonsOnlyError when that node has a CriticalAddonsOnly taint. The old code looks like this: makeSchedulableLoop: for …
A Zero-Sized Bug Hunt in golang.org/x/sync
Wednesday, July 02, 2025 in Blog
Categories:
Series:
… continued from the previous post. While researching the usage of zero-sized types in Go I wrote zerolint1 and the accompanying cmplint2 and examined over 500 popular Go projects. I want to look into some examples why I think those linters …
The Perils of Pointers in the Land of the Zero-Sized Type
Saturday, May 31, 2025 in Blog
Categories:
Series:
Imagine writing a translation function that transforms internal errors into public API errors. In the first iteration, you return nil when no translation takes place. You make a simple change — returning the original error instead of nil — and …
More Concurrency Bugs
Tuesday, April 16, 2024 in Blog
Categories:
Series:
More Real-world Usage Datadog has excellent software engineers. Nevertheless, it’s easy to find code with race conditions. Let’s examine a simplified version of waitForConfigsFromAD: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 …
Concurrency Bugs
Monday, April 15, 2024 in Blog
Categories:
Errors Observed in Real-world Usage In “Problems With Concurrency” I mentioned that I see concurrency issues a lot. Let’s look at something I recently found in production: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 …
Java Structured Concurrency
Wednesday, April 10, 2024 in Blog
Categories:
… continued from the previous post. Structured Concurrency Preview I’ve written about structured concurrency, and Java has a preview API1 StructuredTaskScope2: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import …
Java Virtual Threads
Tuesday, April 09, 2024 in Blog
Categories:
Reading my articles about Go concurrency a friend asked me whether one could something similar in Java. Project Loom Since the release JDK 21 Java has virtual threads1: Thread.startVirtualThread(() -> { System.out.println("Hello, world"); …
How to Write Concurrent Go Code
Thursday, March 28, 2024 in Blog
Categories:
… continued from the previous post. Shuffling through Stack Overflow questions I realized that there is one point I tried to make clear, but didn’t emphasize enough: Write Synchronous Code First Many programs work perfectly fine without …
Existing Libraries
Wednesday, March 27, 2024 in Blog
Categories:
… continued from the previous post. Two Popular Choices Perhaps the most popular exisiting library is golang.org/x/sync/errgroup by Bryan C. Mills: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 package main import ( …