Created
February 16, 2023 01:28
-
-
Save babarot/4f4c1fdef2508b49650f2f6ffe7ad4c5 to your computer and use it in GitHub Desktop.
Get go test coverage and open it in browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
out=/tmp/cover.out | |
html=/tmp/cover.html | |
go test -cover ./... -coverprofile=$out | |
go tool cover -html=$out -o $html | |
open $html | |
sleep 1 | |
rm $out $html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment