https://github.com/rbren/go-acc
Accurate Code Coverage reporting for Golang (Go)
https://github.com/rbren/go-acc
Last synced: 6 months ago
JSON representation
Accurate Code Coverage reporting for Golang (Go)
- Host: GitHub
- URL: https://github.com/rbren/go-acc
- Owner: rbren
- License: apache-2.0
- Fork: true (ory/go-acc)
- Created: 2020-01-15T13:27:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-15T14:12:20.000Z (over 6 years ago)
- Last Synced: 2025-08-15T01:53:00.607Z (11 months ago)
- Language: Go
- Homepage: https://www.ory.am/golang-go-code-coverage-accurate.html
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# go-acc
A tool for reporting accurate Code Coverage in Golang. It is a cross platform (osx, windows, linux) adaption of the following bash script:
```bash
touch ./coverage.tmp
echo 'mode: atomic' > coverage.txt
go list ./... | grep -v /cmd | grep -v /vendor | xargs -n1 -I{} sh -c 'go test -race -covermode=atomic -coverprofile=coverage.tmp -coverpkg $(go list ./... | grep -v /vendor | tr "\n" ",") {} && tail -n +2 coverage.tmp >> coverage.txt || exit 255' && rm coverage.tmp
```
## Installation & Usage
```
$ go get github.com/rbren/go-acc
$ go-acc
A tool for reporting accurate Code Coverage in Golang.
Usage:
go-acc [flags]
Examples:
$ go-acc github.com/some/package
$ go-acc -o my-coverfile.txt github.com/some/package
$ go-acc ./...
$ go-acc $(glide novendor)
Flags:
--covermode string Which code coverage mode to use (default "atomic")
--ignore strings Will ignore packages that contains any of these strings
-o, --output string Location for the output file (default "coverage.txt")
-t, --toggle Help message for toggle
```