Skip to content

Tool for show test coverage in terminal for Go source files

License

Notifications You must be signed in to change notification settings

msoap/go-carpet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 30, 2024
0f38f40 · Sep 30, 2024
Sep 30, 2024
Aug 7, 2022
Nov 13, 2021
Oct 7, 2022
Nov 10, 2018
Sep 8, 2022
Aug 7, 2022
Feb 12, 2017
Aug 7, 2022
Jan 1, 2022
Sep 8, 2022
Aug 7, 2022
Aug 7, 2022
Aug 7, 2022
Mar 14, 2021
Mar 17, 2019
Aug 7, 2022
Feb 27, 2016
Sep 8, 2022
Jan 28, 2018
Sep 3, 2022

Repository files navigation

go-carpet - show test coverage for Go source files

Go Reference Go 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.

The -mincov option allows you to specify a coverage threshold to limit the files to be displayed.

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)
  -mincov float
    	coverage threshold of the file to be displayed (in percent) (default 100)
  -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 install github.com/msoap/go-carpet@latest

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