github.com/msoap/go-carpet@v1.10.1-0.20240316220419-b690da179708/README.md (about) 1 go-carpet - show test coverage for Go source files 2 ================================================== 3 4 [![Go Reference](https://pkg.go.dev/badge/github.com/msoap/go-carpet.svg)](https://pkg.go.dev/github.com/msoap/go-carpet) 5 [![Go](https://github.com/msoap/go-carpet/actions/workflows/go.yml/badge.svg)](https://github.com/msoap/go-carpet/actions/workflows/go.yml) 6 [![Coverage Status](https://coveralls.io/repos/github/msoap/go-carpet/badge.svg?branch=master)](https://coveralls.io/github/msoap/go-carpet?branch=master) 7 [![Report Card](https://goreportcard.com/badge/github.com/msoap/go-carpet)](https://goreportcard.com/report/github.com/msoap/go-carpet) 8 [![Homebrew formula exists](https://img.shields.io/badge/homebrew-🍺-d7af72.svg)](https://github.com/msoap/go-carpet#install) 9 10 To view the test coverage in the terminal, just run `go-carpet`. 11 12 It works outside of the `GOPATH` directory. And it works recursively for multiple packages. 13 14 With `-256colors` option, shades of green indicate the level of coverage. 15 16 By default skip vendor directories (Godeps,vendor), otherwise use `-include-vendor` option. 17 18 The `-mincov` option allows you to specify a coverage threshold to limit the files to be displayed. 19 20 Usage 21 ----- 22 23 usage: go-carpet [options] [paths] 24 -256colors 25 use more colors on 256-color terminal (indicate the level of coverage) 26 -args string 27 pass additional arguments for go test 28 -file string 29 comma-separated list of files to test (default: all) 30 -func string 31 comma-separated functions list (default: all functions) 32 -include-vendor 33 include vendor directories for show coverage (Godeps, vendor) 34 -mincov float 35 coverage threshold of the file to be displayed (in percent) (default 100) 36 -summary 37 only show summary for each file 38 -version 39 get version 40 41 For view coverage in less, use `-R` option: 42 43 go-carpet | less -R 44 45 Install 46 ------- 47 48 From source: 49 50 go install github.com/msoap/go-carpet@latest 51 52 Download binaries from: [releases](https://github.com/msoap/go-carpet/releases) (OS X/Linux/Windows) 53 54 Install from homebrew (OS X): 55 56 brew tap msoap/tools 57 brew install go-carpet 58 # update: 59 brew upgrade go-carpet 60 61 ### Screenshot 62 63 <img width="662" alt="screen shot 2016-03-06" src="https://cloud.githubusercontent.com/assets/844117/13554107/e6c7c82a-e3a7-11e5-82d6-3481f1fead11.png"> 64 65 See also 66 -------- 67 68 * [blog.golang.org](https://blog.golang.org/cover) - the cover story 69 * [gocover.io](https://gocover.io) - simple Go test coverage service 70 * [coveralls.io](https://coveralls.io) - test coverage service 71 * [package cover](https://godoc.org/golang.org/x/tools/cover) - golang.org/x/tools/cover 72 * [gotests](https://github.com/cweill/gotests) - Go commandline tool that generates table driven tests 73 * [docker-golang-checks](https://github.com/msoap/docker-golang-checks) - Go-code checks Docker image