diff options
Diffstat (limited to 'src/cmd/go/doc.go')
-rw-r--r-- | src/cmd/go/doc.go | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go index 0297b7602..a8a9b66aa 100644 --- a/src/cmd/go/doc.go +++ b/src/cmd/go/doc.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// DO NOT EDIT THIS FILE. GENERATED BY mkdoc.sh. +// Edit the documentation in other files and rerun mkdoc.sh to generate this one. + /* Go is a tool for managing Go source code. @@ -56,9 +59,13 @@ build writes the resulting executable to output. Otherwise build compiles the packages but discards the results, serving only as a check that the packages can be built. -The -o flag specifies the output file name. If not specified, the -name is packagename.a (for a non-main package) or the base -name of the first source file (for a main package). +The -o flag specifies the output file name. If not specified, the +output file name depends on the arguments and derives from the name +of the package, such as p.a for package p, unless p is 'main'. If +the package is main and file names are provided, the file name +derives from the first file name mentioned, such as f1 for 'go build +f1.go f2.go'; with no files provided ('go build'), the output file +name is the base name of the containing directory. The build flags are shared by the build, install, run, and test commands: @@ -69,6 +76,9 @@ The build flags are shared by the build, install, run, and test commands: -p n the number of builds that can be run in parallel. The default is the number of CPUs available. + -race + enable data race detection. + Supported only on linux/amd64, darwin/amd64 and windows/amd64. -v print the names of packages as they are compiled. -work @@ -76,20 +86,22 @@ The build flags are shared by the build, install, run, and test commands: do not delete it when exiting. -x print the commands. - -race - enable data race detection. - Supported only on linux/amd64, darwin/amd64 and windows/amd64. -ccflags 'arg list' - arguments to pass on each 5c, 6c, or 8c compiler invocation + arguments to pass on each 5c, 6c, or 8c compiler invocation. -compiler name - name of compiler to use, as in runtime.Compiler (gccgo or gc) + name of compiler to use, as in runtime.Compiler (gccgo or gc). -gccgoflags 'arg list' - arguments to pass on each gccgo compiler/linker invocation + arguments to pass on each gccgo compiler/linker invocation. -gcflags 'arg list' - arguments to pass on each 5g, 6g, or 8g compiler invocation + arguments to pass on each 5g, 6g, or 8g compiler invocation. + -installsuffix suffix + a suffix to use in the name of the package installation directory, + in order to keep output separate from default builds. + If using the -race flag, the install suffix is automatically set to race + or, if set explicitly, has _race appended to it. -ldflags 'flag list' - arguments to pass on each 5l, 6l, or 8l linker invocation + arguments to pass on each 5l, 6l, or 8l linker invocation. -tags 'tag list' a list of build tags to consider satisfied during the build. See the documentation for the go/build package for @@ -679,6 +691,11 @@ Description of testing flags The 'go test' command takes both flags that apply to 'go test' itself and flags that apply to the resulting test binary. +Several of the flags control profiling and write an execution profile +suitable for "go tool pprof"; run "go tool pprof help" for more +information. The --alloc_space, --alloc_objects, and --show_bytes +options of pprof control how the information is presented. + The following flags are recognized by the 'go test' command and control the execution of any test: @@ -716,8 +733,8 @@ control the execution of any test: Write a CPU profile to the specified file before exiting. -memprofile mem.out - Write a memory profile to the specified file when all tests - are complete. + Write a memory profile to the specified file after all tests + have passed. -memprofilerate n Enable more precise (and expensive) memory profiles by setting |