What Golang function could be used to enforce a minimum code coverage and return an Exit1 if false? Follow-up to this Q&amp;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.
There aren't any off the shelf solution currently that allows you to specify a variable number of code coverage percentage.

There is the tool Courtney which enforces 100% code coverage. This tool also allows you to comment on blocks of code which do not need to be covered.