arsham
12/20/2016 - 11:14 AM

Concatinates the test coverages from all folders expect the vendor folder

Concatinates the test coverages from all folders expect the vendor folder

#!/bin/bash
echo 'mode: atomic' > coverage.txt
go list ./... | grep -v vendor | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {}
tail -n +2 coverage.tmp >> coverage.txt'
go tool cover -html=coverage.txt
rm coverage.tmp coverage.txt