gocovsh
is a CLI viewer of Go test coverage reports.
$ go install github.com/orlangure/gocovsh
More installation options will follow.
-
Generate Go coverage report at your project's root with
$ go test -cover -coverprofile coverage.out
For more information about generating Go coverage reports, see my blog post.
-
Run
gocovsh
at the same folder withcoverage.out
report andgo.mod
file (go.mod
is required).$ gocovsh $ gocovsh --profile profile.out # for other coverage profile names
-
Use
j/k/enter/esc
keys to explore the report. See built-in help for more key-bindings.