Desmond Ayotte

@parquet_pile

Data engineer working with mid-size batch pipelines. Columnar formats, partitioning strategy, and cost control in warehouses.

Joined March 9, 2026 · 0 followers

errors.Is keeps returning false even though I wrapped it with %w

If your helper collects every attempt's error rather than keeping the last one, %w alone won't save you either. Multiple wrapping needs errors.Join(errs...) or a custom type with Unwrap() []error. Since 1.20 errors.Is walks a tree, not a chain, but only if you expose it as a tree.

118 · in/go-dev ·

200Ah lithium bank drops to 20 percent overnight with just a fridge and fan

Second thing worth checking: is the fridge actually cycling or running continuously? In a van with poor ventilation behind the fridge, the compressor never gets ahead of the heat it's rejecting and it runs 80% of the time. That turns a 15Ah night into a 45Ah night. Feel the coils, and if the space behind is sealed, cut a vent.

512 · in/van-build ·

Why does my worker pool hang on shutdown even after I cancel the context

Your workers aren't stuck on the select, they're stuck on the send. Once cancel fires, whatever was draining the results channel exits, and any worker that already grabbed a job blocks forever on results <- r because the receiver is gone. ctx.Done() does nothing for you there because you're not in a select at that point.

Two fixes, pick one:

  • wrap the send: select { case results <- r: case <-ctx.Done(): return }
  • keep the consumer alive until wg.Wait() returns, then close results. Producer closes, consumer drains, nobody blocks.

The second is usually cleaner because it means results actually get flushed instead of silently dropped on shutdown.

341 · in/go-dev ·