Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
59fb90ac
Commit
59fb90ac
authored
11 years ago
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/go: document flag passing for tests
Fixes #5566. R=rsc CC=gobot, golang-dev
https://golang.org/cl/9882043
parent
394706b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
src/cmd/go/doc.go
src/cmd/go/doc.go
+7
-1
src/cmd/go/run.go
src/cmd/go/run.go
+1
-0
src/cmd/go/test.go
src/cmd/go/test.go
+6
-1
No files found.
src/cmd/go/doc.go
View file @
59fb90ac
...
@@ -373,6 +373,7 @@ Usage:
...
@@ -373,6 +373,7 @@ Usage:
go run [build flags] gofiles... [arguments...]
go run [build flags] gofiles... [arguments...]
Run compiles and runs the main package comprising the named Go source files.
Run compiles and runs the main package comprising the named Go source files.
A Go source file is defined to be a file ending in a literal ".go" suffix.
For more about build flags, see 'go help build'.
For more about build flags, see 'go help build'.
...
@@ -383,7 +384,7 @@ Test packages
...
@@ -383,7 +384,7 @@ Test packages
Usage:
Usage:
go test [-c] [-i] [build flags] [packages] [flags for test binary]
go test [-c] [-i] [build
and test
flags] [packages] [flags for test binary]
'Go test' automates testing the packages named by the import paths.
'Go test' automates testing the packages named by the import paths.
It prints a summary of the test results in the format:
It prints a summary of the test results in the format:
...
@@ -421,6 +422,11 @@ In addition to the build flags, the flags handled by 'go test' itself are:
...
@@ -421,6 +422,11 @@ In addition to the build flags, the flags handled by 'go test' itself are:
The test binary also accepts flags that control execution of the test; these
The test binary also accepts flags that control execution of the test; these
flags are also accessible by 'go test'. See 'go help testflag' for details.
flags are also accessible by 'go test'. See 'go help testflag' for details.
If the test binary needs any other flags, they should be presented after the
package names. The go tool treats as a flag the first argument that begins with
a minus sign that it does not recognize itself; that argument and all subsequent
arguments are passed as arguments to the test binary.
For more about build flags, see 'go help build'.
For more about build flags, see 'go help build'.
For more about specifying packages, see 'go help packages'.
For more about specifying packages, see 'go help packages'.
...
...
This diff is collapsed.
Click to expand it.
src/cmd/go/run.go
View file @
59fb90ac
...
@@ -16,6 +16,7 @@ var cmdRun = &Command{
...
@@ -16,6 +16,7 @@ var cmdRun = &Command{
Short
:
"compile and run Go program"
,
Short
:
"compile and run Go program"
,
Long
:
`
Long
:
`
Run compiles and runs the main package comprising the named Go source files.
Run compiles and runs the main package comprising the named Go source files.
A Go source file is defined to be a file ending in a literal ".go" suffix.
For more about build flags, see 'go help build'.
For more about build flags, see 'go help build'.
...
...
This diff is collapsed.
Click to expand it.
src/cmd/go/test.go
View file @
59fb90ac
...
@@ -32,7 +32,7 @@ func init() {
...
@@ -32,7 +32,7 @@ func init() {
var
cmdTest
=
&
Command
{
var
cmdTest
=
&
Command
{
CustomFlags
:
true
,
CustomFlags
:
true
,
UsageLine
:
"test [-c] [-i] [build flags] [packages] [flags for test binary]"
,
UsageLine
:
"test [-c] [-i] [build
and test
flags] [packages] [flags for test binary]"
,
Short
:
"test packages"
,
Short
:
"test packages"
,
Long
:
`
Long
:
`
'Go test' automates testing the packages named by the import paths.
'Go test' automates testing the packages named by the import paths.
...
@@ -71,6 +71,11 @@ In addition to the build flags, the flags handled by 'go test' itself are:
...
@@ -71,6 +71,11 @@ In addition to the build flags, the flags handled by 'go test' itself are:
The test binary also accepts flags that control execution of the test; these
The test binary also accepts flags that control execution of the test; these
flags are also accessible by 'go test'. See 'go help testflag' for details.
flags are also accessible by 'go test'. See 'go help testflag' for details.
If the test binary needs any other flags, they should be presented after the
package names. The go tool treats as a flag the first argument that begins with
a minus sign that it does not recognize itself; that argument and all subsequent
arguments are passed as arguments to the test binary.
For more about build flags, see 'go help build'.
For more about build flags, see 'go help build'.
For more about specifying packages, see 'go help packages'.
For more about specifying packages, see 'go help packages'.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment