Follow-up to this Q&A.
How to ensure that a certain minimal code coverage is reached in Golang? E.g. if the CI runs, the build should fail if the code coverage is less than X percent.
In Java, one could use Jacoco and define a minimum code coverage. Other language like Python support minimum code coverage as well.
One option is to simply create a bash script that parsers the output of go test -cover, but I would like to know if there is a off the shelf solution.
go getfor the tool, it will automatically install an executable of Courtney for you. Depending on how you have your $PATH variable set, you should be able to execute the command using either justcourtneyor$GOPATH/bin/courtneyThis is standard functionality for all go modules that have a
– Jessie Barnett Jan 28 '19 at 19:03package main.