Last active
December 28, 2019 01:34
-
-
Save confluentgist/e535b6a777b5a7e2a8962cca25cb3610 to your computer and use it in GitHub Desktop.
Simple way to instrument a Go binary for code coverage
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
// +build testrunmain | |
package main | |
import ( | |
"testing" | |
"github.com/confluentinc/bincover" | |
) | |
func TestRunMain(t *testing.T) { | |
bincover.RunTest(main) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment