diff --git a/bin/go-cov b/bin/go-cov new file mode 100755 index 0000000..caa47b1 --- /dev/null +++ b/bin/go-cov @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -exuo pipefail + +# This `go test` will exit nonzero for test failures. But we still want the +# coverage processing to continue, so force success here. +go test -covermode count -coverpkg ./... -coverprofile cover.out ./... || true +go tool cover -html=cover.out -o cover.html diff --git a/git/gitignore b/git/gitignore index 1318285..c638e10 100644 --- a/git/gitignore +++ b/git/gitignore @@ -26,3 +26,7 @@ node_modules/ .DS_Store .gh-autosquash-default-workflow + +# Go coverage profiles +cover.out +cover.html