New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: add test -coverhtml #22964
Comments
I propose a to allow |
Please don't tie behavioural changes to magic file name interpretation. |
Perhaps instead:
Like -json, this flag would only exist in the go command, not in the actual test binaries. |
Better, but this is still the prototypical kind of thing a small shell script (or function) can solve in a more efficient (and probably even more convenient) way. |
Let's just do this for Go 1.11. |
/cc @bcmills |
I have started a implementation of this feature in zegl@605724f. Before I open a PR I'd like to discuss one thing:
Lines 84 to 88 in 34fb585
Should a "naked" |
Probably yes. CC @jayconrod |
(maybe this shouldn't be a proposal, it seems trivial enough that we should just do it?)
Inspired by rakyll's suggestion in #16768.
I propose a small change to go test's "coverprofile" flag to output both the binary coverage format as well as HTML. The file extension passed in by the user would switch the output format (".html" for HTML, anything else for the existing behaviour).
This change is simple and highly unlikely to break existing users, unlike #16768, which suggests to add additional flags that overlap with "go tool cover" and can quickly descend into supporting more and more flags.
Before:
After:
The text was updated successfully, but these errors were encountered: