Go coverage with external tests
Jan 19, 2016Filippo Valsorda

Summary
This post introduces a technique for capturing Go test coverage data from end-to-end tests, which is not natively supported by the Go toolchain. It details a workaround involving a dummy test that executes the main function and compiles a binary with coverage enabled. The post also explains how to merge this coverage data with unit test coverage using `gocovmerge` for a more complete picture of code execution, specifically mentioning its application in the RRDNS project.
More from the Data Infrastructure & Analytics trail
- Introducing Cloudflare Basin: an open, serverless data platform, now generally available
- Introducing the Billable Usage API: programmatic cost visibility for Cloudflare
- Announcing the Monetization Gateway: charge for any resource behind Cloudflare via x402
- How we built Cloudflare's data platform and an AI agent on top of it
- Iran's Internet is partially restored, Cloudflare Radar data shows