Skip to content
go-carpet - show test coverage in terminal for Go source files
Go Roff Makefile
Branch: master
Clone or download
Latest commit 0cbf2fa Dec 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
testdata Fixed unit test after rename file Feb 25, 2017
.travis.yml New Go version on Travis CI Oct 26, 2019
LICENSE Added LICENSE Feb 28, 2016
Makefile Changed Makefile Nov 10, 2018
README.md Removed snap package Mar 17, 2018
ast.go Added test for getGolangFuncs() Feb 12, 2017
ast_test.go
doc.go Add summary option to README and doc.go Apr 19, 2017
go-carpet.1 Updated version Nov 30, 2019
go-carpet.go Updated version Nov 30, 2019
go-carpet_test.go Don't color filenames in -summary mode Apr 19, 2017
go.mod Updated dependencies Nov 30, 2019
go.sum Updated dependencies Nov 30, 2019
mod.go Added Go modules support Mar 17, 2019
mod_test.go Fixed unittest if run it from GOPATH Mar 17, 2019
terminal_posix.go Renamed go file for POSIX systems Feb 21, 2017
terminal_windows.go Added windows support Feb 27, 2016
unix_only_test.go Removed unused param Jan 28, 2018
utils.go Spell check Jan 28, 2018
utils_test.go Added bypass additional options to go test Feb 12, 2017

README.md

go-carpet - show test coverage for Go source files

GoDoc Build Status Coverage Status Report Card Homebrew formula exists

To view the test coverage in the terminal, just run go-carpet.

It works outside of the GOPATH directory. And it works recursively for multiple packages.

With -256colors option, shades of green indicate the level of coverage.

By default skip vendor directories (Godeps,vendor), otherwise use -include-vendor option.

Usage

usage: go-carpet [options] [paths]
  -256colors
    	use more colors on 256-color terminal (indicate the level of coverage)
  -args string
    	pass additional arguments for go test
  -file string
    	comma-separated list of files to test (default: all)
  -func string
    	comma-separated functions list (default: all functions)
  -include-vendor
    	include vendor directories for show coverage (Godeps, vendor)
  -summary
    	only show summary for each file
  -version
    	get version

For view coverage in less, use -R option:

go-carpet | less -R

Install

From source:

go get -u github.com/msoap/go-carpet
sudo ln -s $(go env GOPATH)/bin/go-carpet /usr/local/bin/go-carpet

Download binaries from: releases (OS X/Linux/Windows)

Install from homebrew (OS X):

brew tap msoap/tools
brew install go-carpet
# update:
brew upgrade go-carpet

Screenshot

screen shot 2016-03-06

See also

You can’t perform that action at this time.