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

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

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

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

Comments

@odeke-em
Copy link
Member

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

Coming here from CL https://go-review.googlesource.com/c/go/+/227547 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
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 28, 2020

Change https://golang.org/cl/230517 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-on: https://go-review.googlesource.com/c/go/+/230517
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
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.