Skip to content

Commit ed9db1d

Browse files
shogohidagopherbot
authored andcommitted
[release-branch.go1.19] cmd/go/internal: update documentation of go test 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 <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Bryan Mills <[email protected]> (cherry picked from commit 93d9035) Reviewed-on: https://go-review.googlesource.com/c/go/+/499295 Run-TryBot: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
1 parent 29f3469 commit ed9db1d

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/cmd/go/alldocs.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/generate/generate.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ Go generate sets several variables when it runs the generator:
8989
generator, containing the Go toolchain and standard library.
9090
$DOLLAR
9191
A dollar sign.
92+
$PATH
93+
The $PATH of the parent process, with $GOROOT/bin
94+
placed at the beginning. This causes generators
95+
that execute 'go' commands to use the same 'go'
96+
as the parent 'go generate' command.
9297
9398
Other than variable substitution and quoted-string evaluation, no
9499
special processing such as "globbing" is performed on the command

src/cmd/go/internal/test/test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ standard output, even if the test printed them to its own standard
9090
error. (The go command's standard error is reserved for printing
9191
errors building the tests.)
9292
93+
The go command places $GOROOT/bin at the beginning of $PATH
94+
in the test's environment, so that tests that execute
95+
'go' commands use the same 'go' as the parent 'go test' command.
96+
9397
Go test runs in two different modes:
9498
9599
The first, called local directory mode, occurs when go test is

0 commit comments

Comments
 (0)