{"id":47705720,"url":"https://github.com/jbunds/coverage","last_synced_at":"2026-04-27T21:01:08.833Z","repository":{"id":346349642,"uuid":"1189069466","full_name":"jbunds/coverage","owner":"jbunds","description":"Go coverage HTML report generator","archived":false,"fork":false,"pushed_at":"2026-04-22T09:38:44.000Z","size":2787,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T11:34:11.055Z","etag":null,"topics":["ci","ci-cd","cicd","coverage","coverage-report","developer-tools","devtools","go","golang","golang-tools","testing","testing-tool","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbunds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T00:08:25.000Z","updated_at":"2026-04-22T09:37:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jbunds/coverage","commit_stats":null,"previous_names":["jbunds/coverage"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/jbunds/coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbunds%2Fcoverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbunds%2Fcoverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbunds%2Fcoverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbunds%2Fcoverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbunds","download_url":"https://codeload.github.com/jbunds/coverage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbunds%2Fcoverage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","ci-cd","cicd","coverage","coverage-report","developer-tools","devtools","go","golang","golang-tools","testing","testing-tool","testing-tools"],"created_at":"2026-04-02T17:56:59.464Z","updated_at":"2026-04-27T21:01:08.824Z","avatar_url":"https://github.com/jbunds.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Version](https://img.shields.io/badge/go-%20v1.26.2-blue?logo=go)](https://github.com/jbunds/coverage/blob/main/go.mod) \u0026nbsp; [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) \u0026nbsp; [![tests](https://github.com/jbunds/coverage/actions/workflows/test-go.yml/badge.svg)](https://github.com/jbunds/coverage/actions/workflows/test-go.yml) \u0026nbsp; [![coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/jbunds/5a36403860174baeee62844ab96a77d9/raw/coverage.json)](https://github.com/jbunds/coverage/actions/workflows/test-go.yml) \u0026nbsp; [![lint](https://github.com/jbunds/coverage/actions/workflows/lint-go.yml/badge.svg)](https://github.com/jbunds/coverage/actions/workflows/lint-go.yml) \u0026nbsp; [![ESLint | neostandard](https://img.shields.io/badge/ESLint-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n\n[simple-tree]:          https://github.com/psnet/simple-tree\n[k8s]:                  https://github.com/kubernetes/kubernetes\n[light theme]:          ./screenshots/light_theme.jpg \"light theme\"\n[dark theme]:           ./screenshots/dark_theme.jpg \"dark theme\"\n[gwatts-gocov-action]:  https://github.com/gwatts/go-coverage-action\n[gwatts-gocov-outputs]: https://github.com/gwatts/go-coverage-action/blob/main/action.yml\n[action]:               https://github.com/jbunds/coverage/blob/main/action.yml\n[workflow]:             https://github.com/jbunds/coverage/blob/main/.github/workflows/pages.yml\n[actions]:              https://docs.github.com/actions\n[workflows]:            https://docs.github.com/actions/concepts/workflows-and-actions/workflows\n[pages]:                https://docs.github.com/pages\n\n#### Simple Web UI for Go Test Coverage\n\nDrop-in replacement for `go tool cover -html`.\n\nThe `coverage` Go module renders an HTML file for each `*.go` source file listed in the specified Go test coverage profile file (typically created per an invocation of `go test -coverprofile \u003cfilename\u003e`).\n\nThe program expects the specification of three flags with corresponding arguments (see [usage](#cli-usage) below):\n\n```\n-gomod         # path to the root go.mod file\n-coverprofile  # path to the Go test coverage profile file\n-path          # path where HTML files will be written\n```\n\nThe generated HTML files are marked up to identify which lines are covered by tests ($\\color{seagreen}{\\text{green}}$), and which lines are not ($\\color{red}{\\text{red}}$). Each HTML file is written to the specified path (per the `-path` flag) following the same directory structure as the source from which the coverage profile file (per the `-coverprofile` flag) was created.\n\nThe program then creates a `tree.html` file which provides a navigable view of the source rendered as a directory tree within an iframe on the left, where each node is either a subdirectory (`📁 \u003csubdirectory\u003e`) or a source file (`\u003csource file\u003e.go`). Clicking on a subdirectory node expands its contents, and clicking on a source file node renders the marked up source in the iframe to the right of the directory tree.\n\nBoth iframes are hosted by a parent `index.html` file, and both HTML files can be inspected in a browser, either directly via the `file://` scheme, or via an HTTP server using the `http://` scheme.\n\nWhen served via HTTP, buttons are available to:\n\n- \u003cimg height=\"20\" style=\"vertical-align: middle;\" alt=\"theme button\"  src=\"./theme.png\" \u003e toggle between **light** and **dark** themes\n- \u003cimg height=\"20\" style=\"vertical-align: middle;\" alt=\"expand button\" src=\"./expand.png\"\u003e toggle between a fully-collapsed and fully-expanded directory tree\n\nSee also [![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/jbunds/coverage) and [![Go Reference](https://pkg.go.dev/badge/github.com/jbunds/coverage.svg)](https://pkg.go.dev/github.com/jbunds/coverage)\n\n---\n\n#### User Interface\n\n[demo.webm](https://github.com/user-attachments/assets/e3651efe-e468-4d0e-8f41-e601e0fa429a)\n\n**light** theme:\n\n![light theme][light theme]\n\n**dark** theme:\n\n![dark theme][dark theme]\n\n---\n\n#### CLI Usage\n\n```\n$ go get github.com/jbunds/coverage\n\n$ go run github.com/jbunds/coverage\ncoverage usage:\n\n  -coverprofile string\n    \tpath to Go test coverage profile file\n  -gomod string\n    \tpath to the root go.mod file\n  -path string\n    \tpath where HTML files will be written\n```\n\n---\n\n#### GitHub Workflow Configuration\n\nAside from the [CLI interface](#cli-usage) outlined above, there are two ways to incorporate the `coverage` module within [GitHub workflows][workflows]:\n\n1. The [`jbunds/coverage@v1`][action] reusable [GitHub Action][actions] generates the test coverage report and writes the files comprising the report to `coverage-report-path`. For example:\n\n```\n- uses: jbunds/coverage@v1\n  with:\n    go-version:           '1.26.2'           # optional; default is '1.26.2'\n    go-mod:               'go.mod'           # optional; default is 'go.mod'\n    coverage-threshold:   '50'               # optional; default is '0'\n    coverage-report-path: 'coverage_report'  # optional; default is 'coverage_report'\n```\n\nThe [`go-version`][action], [`go-mod`][action], [`coverage-threshold`][gwatts-gocov-outputs], and [`coverage-report-path`][workflow] parameters are optional.\n\nAll [outputs][gwatts-gocov-outputs] produced by the [`gwatts/go-coverage-action`][gwatts-gocov-action] workflow step are available downstream via JSON decoding, e.g.:\n\n```\n${{ fromJson(steps.coverage_report.outputs.all).gcov-pathname    }}\n${{ fromJson(steps.coverage_report.outputs.all).report-pathname  }}\n${{ fromJson(steps.coverage_report.outputs.all).coverage-pct     }}\n${{ fromJson(steps.coverage_report.outputs.all).coverage-pct-1dp }}\n${{ fromJson(steps.coverage_report.outputs.all).meets-threshold  }}\n```\n\netc...\n\n2. The [`jbunds/coverage/.github/workflows/pages.yml@v1`][workflow] reusable [GitHub Workflow][workflows] generates the test coverage report and also deploys it to [GitHub Pages][pages]. For example:\n\n```\n- uses: jbunds/coverage/.github/workflows/pages.yml@v1\n  with:\n    go-version:           '1.26.2'           # optional: default is '1.26.2'\n    go-mod:               'go.mod'           # optional; default is 'go.mod'\n    coverage-threshold:   '50'               # optional; default is '0'\n    coverage-report-path: 'coverage_report'  # optional; default is 'coverage_report'\n```\n\nSee https://jbunds.github.io/coverage/ for an example, which is not particularly interesting since it consists of just the four Go source files which implement the module.\n\nThe well-known and relatively large (500k+ LoC) [Kubernetes][k8s] project was chosen for the demo to better illustrate the features and performance.\n\n---\n\n#### But _Why?_\n\nThe motivation for the `coverage` module was to create a relatively minimal alternative to the default HTML interface produced by `go tool cover -html \u003ccoverage profile filename\u003e -o \u003chtml filename\u003e`, with a simple and intuitive UI, and with minimal JavaScript (55 lines total as of this writing, to implement the functionality of the toggle buttons).\n\nThe CSS code was inspired by and adapted from [github.com/psnet/simple-tree][simple-tree], and it clearly still needs to be polished. But I am definitely _not_ a CSS expert, and it fulfills the required behavior as-is.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbunds%2Fcoverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbunds%2Fcoverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbunds%2Fcoverage/lists"}