Skip to content

Commit 0ddd067

Browse files
committed
cmd/go: document changes to go test -c and -o
This was missing from CL 466397. For #15513. Change-Id: I138b7d76842815f4e702d7fe551aa8968097f75b Reviewed-on: https://go-review.googlesource.com/c/go/+/500955 Reviewed-by: Michael Matloob <[email protected]> TryBot-Bypass: Russ Cox <[email protected]>
1 parent 96d8d3e commit 0ddd067

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/cmd/go/alldocs.go

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

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ In addition to the build flags, the flags handled by 'go test' itself are:
145145
the package list (if present) must appear before this flag.
146146
147147
-c
148-
Compile the test binary to pkg.test but do not run it
148+
Compile the test binary to pkg.test in the current directory but do not run it
149149
(where pkg is the last element of the package's import path).
150-
The file name can be changed with the -o flag.
150+
The file name or target directory can be changed with the -o flag.
151151
152152
-exec xprog
153153
Run the test binary using xprog. The behavior is the same as
@@ -160,6 +160,8 @@ In addition to the build flags, the flags handled by 'go test' itself are:
160160
-o file
161161
Compile the test binary to the named file.
162162
The test still runs (unless -c or -i is specified).
163+
If file ends in a slash or names an existing directory,
164+
the test is written to pkg.test in that directory.
163165
164166
The test binary also accepts flags that control execution of the test; these
165167
flags are also accessible by 'go test'. See 'go help testflag' for details.

0 commit comments

Comments
 (0)