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/doc: -src flag misbehaves on some systems [1.14 backport] #38993

Closed
adg opened this issue May 11, 2020 · 5 comments
Closed

cmd/doc: -src flag misbehaves on some systems [1.14 backport] #38993

adg opened this issue May 11, 2020 · 5 comments

Comments

@adg
Copy link
Contributor

@adg adg commented May 11, 2020

Under go1.14.2, if you run go doc -src strings.Compare on macOS you get a bunch of unrelated comments.

Commit 585e31d fixes this issue, but it is not applied in the current release (go1.14.2). It would be great to get this trivial fix cherry picked into the next point release.

(Apologies if I should be using @gopherbot to create this issue; I would have but there wasn't a corresponding issue for the original fix.)

@adg adg added this to the Go1.14.3 milestone May 11, 2020
@andybons andybons modified the milestones: Go1.14.3, Go1.14.4 May 14, 2020
@andybons
Copy link
Member

@andybons andybons commented May 27, 2020

Approved as this is a minor change with no workaround.

@andybons
Copy link
Member

@andybons andybons commented May 27, 2020

@adg can you create the cherry-pick CL (per https://golang.org/wiki/MinorReleases) and add me as a reviewer?

@adg
Copy link
Contributor Author

@adg adg commented May 27, 2020

Note that only the authors of the original CL (or maintainers with the "impersonate" permission) have the ability to create the cherry-pick.

I don't have that permission anymore it seems. :)

@gopherbot
Copy link

@gopherbot gopherbot commented May 28, 2020

Change https://golang.org/cl/235579 mentions this issue: [release-branch.go1.14] cmd/doc: fix merging comments in -src mode

gopherbot pushed a commit that referenced this issue May 28, 2020
These changes fix go doc -src mode that vomits comments from random files if
filesystem does not sort files by name. The issue was with parse.ParseDir
using the Readdir order of files, which varies between platforms and filesystem
implementations. Another option is to merge comments using token.FileSet.Iterate
order in cmd/doc, but since ParseDir is mostly used in go doc, I’ve opted for
smaller change because it’s unlikely to break other uses or cause any perfomance
issues.

Example (macOS APFS): `go doc -src net.ListenPacket`

Fixes #38993

Change-Id: I7f9f368c7d9ccd9a2cbc48665f2cb9798c7b3a3f
GitHub-Last-Rev: 654fb45
GitHub-Pull-Request: #36104
Reviewed-on: https://go-review.googlesource.com/c/go/+/210999
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
(cherry picked from commit 585e31d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/235579
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented May 28, 2020

Closed by merging a68b7d3 to release-branch.go1.14.

@gopherbot gopherbot closed this May 28, 2020
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.