Skip to content

Commit 93d9035

Browse files
shogohidagopherbot
authored andcommitted
cmd/go/internal: update documentation of go test and go generate
Fixes #57050 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]>
1 parent 46847c6 commit 93d9035

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
@@ -90,6 +90,11 @@ Go generate sets several variables when it runs the generator:
9090
generator, containing the Go toolchain and standard library.
9191
$DOLLAR
9292
A dollar sign.
93+
$PATH
94+
The $PATH of the parent process, with $GOROOT/bin
95+
placed at the beginning. This causes generators
96+
that execute 'go' commands to use the same 'go'
97+
as the parent 'go generate' command.
9398
9499
Other than variable substitution and quoted-string evaluation, no
95100
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
@@ -87,6 +87,10 @@ standard output, even if the test printed them to its own standard
8787
error. (The go command's standard error is reserved for printing
8888
errors building the tests.)
8989
90+
The go command places $GOROOT/bin at the beginning of $PATH
91+
in the test's environment, so that tests that execute
92+
'go' commands use the same 'go' as the parent 'go test' command.
93+
9094
Go test runs in two different modes:
9195
9296
The first, called local directory mode, occurs when go test is

0 commit comments

Comments
 (0)