Skip to content

Instantly share code, notes, and snippets.

@FrenchBen
Created June 29, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrenchBen/cbdc889a55413367151ed06ab5ab81b2 to your computer and use it in GitHub Desktop.
Save FrenchBen/cbdc889a55413367151ed06ab5ab81b2 to your computer and use it in GitHub Desktop.
Golang go alias
function go_cover() {
coverage=$(mktemp)
trap "rm -f ${coverage}" EXIT
go test -coverprofile=${coverage} "$@" && \
go tool cover -func=${coverage} && \
go tool cover -html=${coverage}
}
alias go_cover='go_cover'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment