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
Comments
Approved as this is a minor change with no workaround. |
@adg can you create the cherry-pick CL (per https://golang.org/wiki/MinorReleases) and add me as a reviewer? |
I don't have that permission anymore it seems. :) |
Change https://golang.org/cl/235579 mentions this issue: |
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>
Closed by merging a68b7d3 to release-branch.go1.14. |
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.)
The text was updated successfully, but these errors were encountered: