Skip to content

Instantly share code, notes, and snippets.

@jovandeginste
Created May 5, 2020 09:18
Show Gist options
  • Save jovandeginste/8cd53fca75340eaa65b45c415f057206 to your computer and use it in GitHub Desktop.
Save jovandeginste/8cd53fca75340eaa65b45c415f057206 to your computer and use it in GitHub Desktop.
#!/bin/bash -eu
COVERFILE=$(mktemp "coverXXX.out")
trap "{ rm -vf $COVERFILE; }" EXIT
DIR=${1:-./...}
case "${FULL:-no}" in
y*)
: ${REV:=}
: ${P:=--color=always}
;;
*)
: ${REV:=HEAD~1}
: ${P:=-n --color=always}
;;
esac
set -x
go test -mod vendor -coverprofile="$COVERFILE" "$DIR"
go tool cover -func="$COVERFILE"
golangci-lint run --config ~/.golangci.yml --new-from-rev "${REV}" $P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment