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/go: document GOROOT/bin/go PATH entry for go test and go generate #57050

Closed
bcmills opened this issue Dec 2, 2022 · 6 comments
Closed

cmd/go: document GOROOT/bin/go PATH entry for go test and go generate #57050

bcmills opened this issue Dec 2, 2022 · 6 comments
Labels
Documentation GoCommand cmd/go help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 2, 2022

CL 404134 (in Go 1.19) changed go test and go generate to always place GOROOT/bin at the beginning of the PATH list for the subprocess.

I added a release note for it (in CL 409176), but forget to update the documentation for the actual commands. It should be mentioned explicitly in the documentation for go test and go generate.

@bcmills bcmills added Documentation help wanted NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go labels Dec 2, 2022
@bcmills bcmills added this to the Backlog milestone Dec 2, 2022
@shogohida
Copy link
Contributor

shogohida commented Jan 15, 2023

Hi @bcmills, can I work on this? I assume I need to update the documentation in these files.

https://github.com/golang/go/blob/master/src/cmd/go/internal/generate/generate.go
https://github.com/golang/go/blob/master/src/cmd/go/internal/test/test.go

Should I refer to this?

cmd/go: place GOROOT/bin at the beginning of PATH in 'go generate' and 'go test'

This causes tests and generators that execute 'go' as a subprocess to
use the same go command as the parent 'go test' or 'go generate'
command.

@gopherbot
Copy link

Change https://go.dev/cl/461683 mentions this issue: cmd/go/internal: update documentation of go test and go generate

@dmitshur
Copy link
Contributor

dmitshur commented May 26, 2023

@gopherbot Please consider this as a backport to Go 1.20 and 1.19.

This is a documentation-only fix to document a Go 1.19 feature added to go test and go generate. It'll be easier for users who wish to rely on it to do so when it's documented, and avoids confusion about it otherwise only appearing in cmd/go documentation in Go 1.21 onwards.
(I'm happy to help with preparing backport CLs if approved.)

@gopherbot
Copy link

gopherbot commented May 26, 2023

Backport issue(s) opened: #60457 (for 1.19), #60458 (for 1.20), #60459 (for 1.21).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@gopherbot
Copy link

Change https://go.dev/cl/499218 mentions this issue: [release-branch.go1.20] cmd/go/internal: update documentation of go test and go generate

@gopherbot
Copy link

Change https://go.dev/cl/499295 mentions this issue: [release-branch.go1.19] cmd/go/internal: update documentation of go test and go generate

gopherbot pushed a commit that referenced this issue May 30, 2023
…est and go generate

For #57050.
Fixes #60457.

Change-Id: I46cac667ff78ac171c878f4366f8f01f58f1d27d
GitHub-Last-Rev: 697c255
GitHub-Pull-Request: #57814
Reviewed-on: https://go-review.googlesource.com/c/go/+/461683
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
(cherry picked from commit 93d9035)
Reviewed-on: https://go-review.googlesource.com/c/go/+/499295
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
gopherbot pushed a commit that referenced this issue May 30, 2023
…est and go generate

For #57050.
Fixes #60458.

Change-Id: I46cac667ff78ac171c878f4366f8f01f58f1d27d
GitHub-Last-Rev: 697c255
GitHub-Pull-Request: #57814
Reviewed-on: https://go-review.googlesource.com/c/go/+/461683
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
(cherry picked from commit 93d9035)
Reviewed-on: https://go-review.googlesource.com/c/go/+/499218
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation GoCommand cmd/go help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants