Installation • Command-line completion • Man documentation • Usage • CI Status • Contributing • License
htmlcov
is an utility for converting Go coverage profiles into HTML pages. It's just better version of go tool cover -html=cover.out -o coverage.html
command.
To build the htmlcov
from scratch, make sure you have a working Go 1.18+ workspace (instructions), then:
go install github.com/essentialkaos/htmlcov@latest
You can download prebuilt binaries for Linux and macOS from EK Apps Repository:
bash <(curl -fsSL https://apps.kaos.st/get) htmlcov
You can generate completion for bash
, zsh
or fish
shell.
Bash:
sudo htmlcov --completion=bash 1> /etc/bash_completion.d/htmlcov
ZSH:
sudo htmlcov --completion=zsh 1> /usr/share/zsh/site-functions/htmlcov
Fish:
sudo htmlcov --completion=fish 1> /usr/share/fish/vendor_completions.d/htmlcov.fish
You can generate man page using next command:
htmlcov --generate-man | sudo gzip > /usr/share/man/man1/htmlcov.1.gz
Usage: htmlcov {options} coverage-file
Options
--output, -o file Output file (default: coverage.html)
--remove, -R Delete input file after successful generation
--no-color, -nc Disable colors in output
--help, -h Show this help message
--version, -v Show version
Examples
go test -coverprofile=cover.out ./... && htmlcov cover.out
Create coverage profile and convert it to HTML
go test -coverprofile=cover.out ./... && htmlcov -R -o report.html cover.out
Create coverage profile and convert it to HTML, save as report.html and remove profile
Branch | Status |
---|---|
master |
|
develop |
Before contributing to this project please read our Contributing Guidelines.