From 82c9cb668a8996cb7cdc0c17a1ccf5b613e3396a Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Mon, 18 Mar 2024 17:04:03 -0700 Subject: [PATCH] bin: go-cov --- bin/go-cov | 8 ++++++++ git/gitignore | 4 ++++ 2 files changed, 12 insertions(+) create mode 100755 bin/go-cov 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