-
Notifications
You must be signed in to change notification settings - Fork 18k
go/build: erroneous contents for Doc field in *Package for image package #23594
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
Comments
I would have put the bit of code on the playground but using go/build doesn't work there. Is that another bug or just a limitation of the playground? |
Nice find.
Depends on how you view it. The playground's filesystem is fake -- see "Faking the file system" in https://blog.golang.org/playground. It can be prepopulated, so we could prepopulate it with the standard library. But I don't really think that'd be worth the effort. FWIW, I actually prefer pasted code to playground links, at least for small bits of code. Making skimming issues easier, particularly on my phone. |
@josharian fair enough, filed #23603 nonetheless, since it would be useful albeit niche. (anchored link to section Faking the file system) |
@jimmyfrasche it seems like you described a patch above - why not send it as a CL? |
Change https://golang.org/cl/96976 mentions this issue: |
@mvdan a fatal combination of laziness and forgetfulness—thanks for the reminder! In testing I found this issue also affected the |
and
and
all print
rather than
which is the correct package synopsis.
The erroneous synopsis comes from the package documentation of the image_test package which provides the package-level Example.
It's possible that other packages are effected but this is the only one I found.
From a cursory look at
*go/build.Context.Import
it appears that this is caused by the loop grabbing the first synopsis found in any file (lines 816-818 below) when it seems as if it should ignore test and xtest files using the variablesisTest
andisXTest
go/src/go/build/build.go
Lines 798 to 818 in 00587e8
System details
The text was updated successfully, but these errors were encountered: