# Golang Test Coverage

> Report Go test coverage for all packages. TIL note about golang. Use when working with golang and the user mentions test coverage or related topics. Use when this capability is needed.

- Skill: `tomevault-io/golang-test-coverage` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/golang-test-coverage`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/golang-test-coverage/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/golang-test-coverage

---


# Report Go test coverage for all packages

Write coverage to file `cover.out` and then print a report based on it
```bash
go test ./... -coverprofile cover.out
go tool cover -func cover.out
```

Same as above but a one-liner using a tmp file, which is `rm`-ed at the end
```bash
OUT=$(mktemp); go test ./... -coverprofile="$OUT" && go tool cover -func="$OUT"; rm "$OUT"
```

---
> Source: [kfet/til](https://github.com/kfet/til) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->

