Get the latest tech news
A subtle bug with Go's errgroup
Published on 2025-08-09 Yesterday I got bitten by an insidious bug at work while working on Kratos. Fortunately a test caught it before it got merged.
I mean, it makes sense that the context is canceled on the first error occurring, that's how operations in other goroutines can notice and also stop early. Some newer programming languages have outright banned variable shadowing, like Zig, I presume to prevent such issues. Things get even muddier when we notice that after g.Wait(ctx), we do the password length check, and that gets to run, contrary to the checkHaveIBeenPawned call.
Or read this on Hacker News