Skip to content

Instantly share code, notes, and snippets.

@aamironline
Last active November 17, 2022 02:23
Show Gist options
  • Save aamironline/5470000ca61542a522ba5a9cff69b811 to your computer and use it in GitHub Desktop.
Save aamironline/5470000ca61542a522ba5a9cff69b811 to your computer and use it in GitHub Desktop.
Runs tests and generate coverage report for your Go projects
#!/bin/sh
# This script is used to generate test coverage reports for the
# go project. It is intended to be run from the root of the project
# directory.
echo "Running tests and generating coverage report..."
go test -coverprofile=coverage.out
echo "Opening coverage report..."
go tool cover -html=coverage.out
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment