Gocovsh
Go Coverage in your terminal: a tool for exploring Go Coverage reports from the command line π»
`gocovsh` is a tool for exploring [Go Coverage reports](https://go.dev/blog/cover) from the command line. The project is written primarily in Go, distributed under the GNU General Public License v3.0 license, first published in 2022. Key topics include: cli, coverage, coverage-report, go, golang.
<div align="center">Gocovsh - Go Coverage in your terminal</div>
gocovsh is a tool for exploring Go Coverage
reports from the command line.
Don't skip the Giving back section! π°
Demo below π¬ π
There is a Russian word ΠΠΎΠ²Ρ (pronounced like "Kovsh") which means a ladle
or a dipper. "The Big Dipper" is
also a part of the constellation Ursa
Major, thus the friendly
dipper-shaped Gopher mascot, created by Michael Zolotov.
<div align="center">

</div>
Installation
Using Homebrew
bashbrew install orlangure/tap/gocovsh
Pre-built binary
Grab your pre-built binary from the
Releases page.
From source
bash# install latest, probably unreleased version go install github.com/orlangure/gocovsh@latest # or install a specific version go install github.com/orlangure/gocovsh@v0.5.1
Usage
-
Generate Go coverage report at your project's root with
bashgo test -cover -coverprofile coverage.outFor more information about generating Go coverage reports, see π my blog
post. -
Run
gocovshat the same folder withcoverage.outreport andgo.mod
file (go.modis required).bashgocovsh # show all files from coverage report git diff --name-only | gocovsh # only show changed files git diff | gocovsh # show coverage on top of current diff gocovsh --profile profile.out # for other coverage profile names -
Use
j/k/enter/esckeys to explore the report. See built-in help for more
key-bindings.
Themes
gocovsh supports 4 nice themes (using Catppuccin
Theme project) and an ugly default
one at this moment. To change the theme, set GOCOVSH_THEME environment
variable to one of the following values: mocha, latte, frappe or
macchiato:
bashGOCOVSH_THEME=mocha gocovsh GOCOVSH_THEME=latte gocovsh GOCOVSH_THEME=frappe gocovsh GOCOVSH_THEME=macchiato gocovsh
To always use the same theme, add export GOCOVSH_THEME=<theme name> to your
~/.bashrc, ~/.zshrc or any other file that you use for shell configuration.
Giving back
This is a free and open source project that hopefully helps its users, at least
a little. Even though I don't need donations to support it, I understand that
there are people that wish to give back anyway. If you are one of them, I
encourage you to plant some trees with Tree
Nation π² π³ π΄
If you want me to know about your contribution, make sure to use
orlangure+gocovsh@gmail.com as the recipient email.
Thank you!
Demo
Viewing Go code coverage reports

Only show Go code coverage of changed files

Go code coverage on top of git diff

Contributors
Showing top 8 contributors by commit count.
