I have just released v1.5.1 of the Prometheus API and instrumentation client for Go.
It’s a bugfix release that gets rid of yet another codepath where a superfluous WriteHeader call can happen. Have a look at PR #726 for more context. Special shoutout to @woodsaj, who found the (in hindsight, as so often, very obvious) bug. This should also fix the infamous issue #6139 in prometheus/prometheus.
WriteHeader call.