x/tools/go/packages: package loader in 1.14 broke go doc examples? #38376
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I try to load package examples. In 1.13 I get the right example, in 1.14 I get the entire file and replaces the example code with
func main() { ... }
.Look at pkg.go.dev or go doc examples.
What did you expect to see?
What was shown in go 1.13 - only the example code.
What did you see instead?
The entire test file with the example code replaced with
func main() { ... }
.More details
The code below behaves differently in 1.13 and 1.14:
In 1.13
fmt.Println(examples[0].Play)
printsnil
for thefuzzing
package, though in 1.14 it prints non-nil object. This breaks what gddo expects in https://github.com/golang/gddo/blob/master/doc/builder.go#L233. I think.The text was updated successfully, but these errors were encountered: