summaryrefslogtreecommitdiff
path: root/src/cmd/go/doc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/doc.go')
-rw-r--r--src/cmd/go/doc.go90
1 files changed, 75 insertions, 15 deletions
diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go
index 27be32bf3..e2df7beb1 100644
--- a/src/cmd/go/doc.go
+++ b/src/cmd/go/doc.go
@@ -10,16 +10,18 @@ Usage: go command [arguments]
The commands are:
build compile packages and dependencies
+ clean remove object files
doc run godoc on package sources
- fix run gofix on packages
+ fix run go tool fix on packages
fmt run gofmt on package sources
get download and install packages and dependencies
install compile and install packages and dependencies
list list packages
run compile and run Go program
test test packages
+ tool run specified go tool
version print Go version
- vet run govet on packages
+ vet run go tool vet on packages
Use "go help [command]" for more information about a command.
@@ -67,6 +69,48 @@ For more about import paths, see 'go help importpath'.
See also: go install, go get, go clean.
+Remove object files
+
+Usage:
+
+ go clean [-i] [-r] [-n] [-x] [importpath...]
+
+Clean removes object files from package source directories.
+The go command builds most objects in a temporary directory,
+so go clean is mainly concerned with object files left by other
+tools or by manual invocations of go build.
+
+Specifically, clean removes the following files from each of the
+source directories corresponding to the import paths:
+
+ _obj/ old object directory, left from Makefiles
+ _test/ old test directory, left from Makefiles
+ _testmain.go old gotest file, left from Makefiles
+ test.out old test log, left from Makefiles
+ build.out old test log, left from Makefiles
+ *.[568ao] object files, left from Makefiles
+
+ DIR(.exe) from go build
+ DIR.test(.exe) from go test -c
+ MAINFILE(.exe) from go build MAINFILE.go
+
+In the list, DIR represents the final path element of the
+directory, and MAINFILE is the base name of any Go source
+file in the directory that is not included when building
+the package.
+
+The -i flag causes clean to remove the corresponding installed
+archive or binary (what 'go install' would create).
+
+The -n flag causes clean to print the remove commands it would execute,
+but not run them.
+
+The -r flag causes clean to be applied recursively to all the
+dependencies of the packages named by the import paths.
+
+The -x flag causes clean to print remove commands as it executes them.
+
+
Run godoc on package sources
Usage:
@@ -84,18 +128,18 @@ To run godoc with specific options, run godoc itself.
See also: go fix, go fmt, go vet.
-Run gofix on packages
+Run go tool fix on packages
Usage:
go fix [importpath...]
-Fix runs the gofix command on the packages named by the import paths.
+Fix runs the Go fix command on the packages named by the import paths.
-For more about gofix, see 'godoc gofix'.
+For more about fix, see 'godoc fix'.
For more about import paths, see 'go help importpath'.
-To run gofix with specific options, run gofix itself.
+To run fix with specific options, run 'go tool fix'.
See also: go fmt, go vet.
@@ -132,7 +176,7 @@ and 'go install'. See 'go help install'.
The -d flag instructs get to stop after downloading the packages; that is,
it instructs get not to install the packages.
-The -fix flag instructs get to run gofix on the downloaded packages
+The -fix flag instructs get to run the fix tool on the downloaded packages
before resolving dependencies or building the code.
The -u flag instructs get to use the network to update the named packages
@@ -252,7 +296,7 @@ Test packages
Usage:
- go test [-c] [-file a.go -file b.go ...] [-p n] [-x] [importpath...] [flags for test binary]
+ go test [-c] [-file a.go -file b.go ...] [-i] [-p n] [-x] [importpath...] [flags for test binary]
'Go test' automates testing the packages named by the import paths.
It prints a summary of the test results in the format:
@@ -285,6 +329,18 @@ See 'go help importpath' for more about import paths.
See also: go build, go vet.
+Run specified go tool
+
+Usage:
+
+ go tool command [args...]
+
+Tool runs the go tool command identified by the arguments.
+With no arguments it prints the list of known tools.
+
+For more about each tool command, see 'go tool command -h'.
+
+
Print Go version
Usage:
@@ -294,18 +350,18 @@ Usage:
Version prints the Go version, as reported by runtime.Version.
-Run govet on packages
+Run go tool vet on packages
Usage:
go vet [importpath...]
-Vet runs the govet command on the packages named by the import paths.
+Vet runs the Go vet command on the packages named by the import paths.
-For more about govet, see 'godoc govet'.
+For more about vet, see 'godoc vet'.
For more about import paths, see 'go help importpath'.
-To run govet with specific options, run govet itself.
+To run the vet tool with specific options, run 'go tool vet'.
See also: go fmt, go fix.
@@ -487,19 +543,23 @@ and flags that apply to the resulting test binary.
The flags handled by 'go test' are:
- -c Compile the test binary to test.out but do not run it.
+ -c Compile the test binary to pkg.test but do not run it.
-file a.go
Use only the tests in the source file a.go.
Multiple -file flags may be provided.
+ -i
+ Install packages that are dependencies of the test.
+
-p n
Compile and test up to n packages in parallel.
The default value is the number of CPUs available.
-x Print each subcommand go test executes.
-The resulting test binary, called test.out, has its own flags:
+The resulting test binary, called pkg.test, where pkg is the name of the
+directory containing the package sources, has its own flags:
-test.v
Verbose output: log all tests as they are run.
@@ -557,7 +617,7 @@ here are passed through unaltered. For instance, the command
will compile the test binary using x_test.go and then run it as
- test.out -test.v -test.cpuprofile=prof.out -dir=testdata -update
+ pkg.test -test.v -test.cpuprofile=prof.out -dir=testdata -update
Description of testing functions