Skip to content

Instantly share code, notes, and snippets.

@rkravchik
Last active June 7, 2018 12:41
Show Gist options
  • Select an option

  • Save rkravchik/d4050f6e5304266c7775044c63ad9a59 to your computer and use it in GitHub Desktop.

Select an option

Save rkravchik/d4050f6e5304266c7775044c63ad9a59 to your computer and use it in GitHub Desktop.
fast and conveniently covering go packages with tests
#!/bin/bash
go test -coverprofile cover.out $(go list)
go tool cover -html=cover.out -o cover.html
curl -T cover.html https://t.bk.ru
rm cover.out cover.html
#!/bin/bash
GITROOT=$(git rev-parse --show-toplevel 2> /dev/null)
if [ -d "$GITROOT/_vendor" ]; then
GOPATH="$GITROOT/_vendor" $@
else
$@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment