Skip to content

Instantly share code, notes, and snippets.

@secnot
Last active June 18, 2017 10:30
Show Gist options
  • Save secnot/1a08321e977ea6464dd05bcabcbdf086 to your computer and use it in GitHub Desktop.
Save secnot/1a08321e977ea6464dd05bcabcbdf086 to your computer and use it in GitHub Desktop.
Generate Go package test coverage
$ go get -u github.com/username/repo
# Profile test
$ go test -coverprofile cover.out github.com/username/repo
# Generate nicer html representation from profiles
$ go tool cover -html=cover.out -o cover.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment