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

go/doc: whole file is used as example even when there are tests or benchmarks [1.14 backport] #38418

Closed
gopherbot opened this issue Apr 13, 2020 · 4 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@FiloSottile requested issue #38409 to be considered for backport to the next 1.14 minor release.

@gopherbot please open a backport issue for 1.14.

This is a regression that impacts user visible documentations, without a workaround on the doc generation side (as opposed to modifying the target source, which might be an existing version or third-party).

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Apr 13, 2020
@gopherbot gopherbot added this to the Go1.14.3 milestone Apr 13, 2020
@andybons
Copy link
Member

Approved as this is primarily a documentation issue with no workaround (outside of modifying the target source). The change is minimal as well.

@andybons andybons added the CherryPickApproved Used during the release process for point releases label Apr 27, 2020
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Apr 27, 2020
@gopherbot
Copy link
Author

Change https://golang.org/cl/232868 mentions this issue: [release-branch.go1.14] go/doc: fix detection of whole file examples

@gopherbot
Copy link
Author

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

gopherbot pushed a commit that referenced this issue May 11, 2020
After CL 211357 (commit 499dc1c),
hasTests and numDecl were not updated properly for function
declarations with parameters, which affected the whole file
example detection logic. This caused examples like

	package foo_test

	func Foo(x int) {
	}

	func Example() {
		fmt.Println("Hello, world!")
		// Output: Hello, world!
	}

to not be detected as whole file ones.

Fixes #38418.
For #38409.

Change-Id: I9ebd47e52d7ee9d91eb6f8e0257511de69b2a402
GitHub-Last-Rev: cc71c31
GitHub-Pull-Request: #37730
Reviewed-on: https://go-review.googlesource.com/c/go/+/222477
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit c4961dc)
Reviewed-on: https://go-review.googlesource.com/c/go/+/232868
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Gregory Petrosyan <gregory.petrosyan@gmail.com>
@flyingmutant
Copy link
Contributor

Is there an ETA for https://godoc.org and https://pkg.go.dev updating to 1.14.3?

@golang golang locked and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants