Skip to content
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/cover: add PackageName to title of generated html #38609

odeke-em opened this issue Apr 23, 2020 · 1 comment

cmd/cover: add PackageName to title of generated html #38609

odeke-em opened this issue Apr 23, 2020 · 1 comment


Copy link

@odeke-em odeke-em commented Apr 23, 2020

Coming here from CL in which we merged an update that added a blank title to each generated page as "Go Coverage Report".

This issue is to remind @robpike and myself about making the title even more contextual and more useful by adding the package name to the title.

@odeke-em odeke-em changed the title cmd/cover: add PackageName to title cmd/cover: add PackageName to title of generated html Apr 23, 2020
Copy link

@gopherbot gopherbot commented Apr 28, 2020

Change mentions this issue: cmd/cover: include a package name in the HTML title

@gopherbot gopherbot closed this in 41f6388 Apr 30, 2020
xujianhai666 added a commit to xujianhai666/go-1 that referenced this issue May 21, 2020
A recent change added a title to the HTML coverage report but
neglected to include the package name. Add the package name here.
It's a little trickier than you'd think because there may be multiple
packages and we don't want to parse the files, so we just extract
a directory name from the path of the first file.  This will almost
always be right, and has the advantage that it gives a better result
for package main. There are rare cases it will get wrong, but that
will be no hardship.

If this turns out not to be good enough, we can refine it.

Fixes golang#38609

Change-Id: I2201f6caef906e0b0258b90d7de518879041fe72
Reviewed-by: Ian Lance Taylor <>
Run-TryBot: Ian Lance Taylor <>
TryBot-Result: Gobot Gobot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.