A | B | C | D | E | F | G | H | I | J | K | L | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Flag | Type | UsageArgument | Usage | Long Doc | Build Time? | Run Time? | Include? | Section | New Name | Needs binary? | Comments |
2 | Flags from go build (SOURCE: go help build) | |||||||||||
3 | -a | bool | force rebuilding of packages that are already up-to-date. | YES | NO | YES | go-build | |||||
4 | -n | bool | print the commands but do not run them. | YES | NO | YES | go-build | Test | ||||
6 | -race | bool | enable data race detection. Supported only on linux/amd64, freebsd/amd64, darwin/amd64, windows/amd64, linux/ppc64le and linux/arm64 (only for 48-bit VMA). | YES | NO | YES | code-and-coverage-analysis | |||||
7 | -msan | bool | enable interoperation with memory sanitizer. Supported only on linux/amd64, linux/arm64 and only with Clang/LLVM as the host C compiler. On linux/arm64, pie build mode will be used. | YES | NO | YES | go-build | |||||
9 | -work | bool | print the name of the temporary work directory and do not delete it when exiting. | YES | NO | YES | go-build | |||||
10 | -x | bool | print the commands. | YES | NO | YES | go-build | Test this to make sure it works | ||||
11 | -asmflags | string | '[pattern=]arg list' | arguments to pass on each go tool asm invocation. | YES | NO | YES | go-build | ||||
12 | -buildmode | string | mode | build mode to use. See 'go help buildmode' for more. | YES | NO | YES | go-build | ||||
13 | -compiler | string | name | name of compiler to use, as in runtime.Compiler (gccgo or gc). | YES | NO | YES | go-build | ||||
14 | -gccgoflags | string | '[pattern=]arg list' | arguments to pass on each gccgo compiler/linker invocation. | YES | NO | YES | go-build | ||||
15 | -gcflags | string | '[pattern=]arg list' | arguments to pass on each go tool compile invocation. | YES | NO | YES | go-build | ||||
16 | -installsuffix | string | 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 raceor, if set explicitly, has _race appended to it. Likewise for the -msan flag. Using a -buildmode option that requires non-default compile flags has a similar effect. | YES | NO | YES | go-build | |||||
17 | -ldflags | string | '[pattern=]arg list' | arguments to pass on each go tool link invocation. | YES | NO | YES | go-build | ||||
18 | -linkshared | bool | build code that will be linked against shared libraries previously created with -buildmode=shared. | YES | NO | YES | go-build | |||||
19 | -mod mode | string | mode (readonly, vender, or mod) | module download mode to use: readonly, vendor, or mod. See 'go help modules' for more. | YES | NO | YES | go-build | ||||
20 | -modcacherw | bool | leave newly-created directories in the module cache read-write instead of making them read-only. | YES | NO | YES | go-build | |||||
21 | -modfile | string | file | in module aware mode, read (and possibly write) an alternate go.mod file instead of the one in the module root directory. A file named go.mod must still be present in order to determine the module root directory, but it is not accessed. When -modfile is specified, an alternate go.sum file is also used: its path is derived from the -modfile flag by trimming the ".mod" extension and appending ".sum". | YES | NO | YES | go-build | ||||
22 | -pkgdir | string | dir | install and load all packages from dir instead of the usual locations. For example, when building with a non-standard configuration, use -pkgdir to keep generated packages in a separate location. | YES | NO | YES | go-build | ||||
23 | -tags | string | tag,list | a comma-separated list of build tags to consider satisfied during the build. For more information about build tags, see the description of build constraints in the documentation for the go/build package. (Earlier versions of Go used a space-separated list, and that form is deprecated but still recognized.) | YES | NO | YES | go-build | ||||
24 | -trimpath | bool | remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin with either "go" (for the standard library), or a module path@version (when using modules), or a plain import path (when using GOPATH). | YES | NO | YES | go-build | |||||
25 | -toolexec | string | 'cmd args' | a program to use to invoke toolchain programs like vet and asm. For example, instead of running asm, the go command will run cmd args /path/to/asm <arguments for asm>'. | YES | NO | YES | go-build | ||||
26 | Flags from go test (SOURCE: go test -asdf, with docs from go help testflag merged in) | |||||||||||
30 | -test.blockprofile | string | file | write a goroutine blocking profile to file | Write a goroutine blocking profile to the specified file when all tests are complete. Writes test binary as -c would. | NO | YES | YES | performance-analysis | YES | Go test does not support multiple packages. | |
31 | -test.blockprofilerate | int | rate | set blocking profile rate (see runtime.SetBlockProfileRate) | Control the detail provided in goroutine blocking profiles by calling runtime.SetBlockProfileRate with rate. See 'go doc runtime.SetBlockProfileRate'. The profiler aims to sample, on average, one blocking event every n nanoseconds the program spends blocked. By default, if -test.blockprofile is set without this flag, all blocking events are recorded, equivalent to -test.blockprofilerate=1. | NO | YES | YES | performance-analysis | |||
33 | -test.coverprofile | string | file | write a coverage profile to file | Write a coverage profile to the file after all tests have passed. Sets -cover. | NO | YES | YES | code-and-coverage-analysis | |||
35 | -test.cpuprofile | string | file | write a cpu profile to file | Write a CPU profile to the specified file before exiting. Writes test binary as -c would. | NO | YES | YES | performance-analysis | YES | Go test does not support multiple packages. | |
38 | -test.memprofile | string | file | write an allocation profile to file | Write an allocation profile to the file after all tests have passed. Writes test binary as -c would. | NO | YES | YES | performance-analysis | YES | Go test does not support multiple packages. | |
39 | -test.memprofilerate | int | rate | set memory allocation profiling rate (see runtime.MemProfileRate) | Enable more precise (and expensive) memory allocation profiles by setting runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'. To profile all memory allocations, use -test.memprofilerate=1. | NO | YES | YES | performance-analysis | |||
40 | -test.mutexprofile | string | file | write a mutex contention profile to the named file after execution | Write a mutex contention profile to the specified file when all tests are complete. Writes test binary as -c would. | NO | YES | YES | performance-analysis | YES | Go test does not support multiple packages. | |
41 | -test.mutexprofilefraction | int | n | if >= 0, calls runtime.SetMutexProfileFraction() | Sample 1 in n stack traces of goroutines holding a contended mutex. | NO | YES | YES | performance-analysis | |||
48 | -test.trace | string | file | write an execution trace to file | Write an execution trace to the specified file before exiting. | NO | YES | YES | performance-analysis | execution-trace | Go test does not support multiple packages. | |
50 | Additional go test flags from go help testflag (SOURCE: go help testflag) | |||||||||||
51 | -cover | bool | Enable coverage analysis. | Note that because coverage works by annotating the source code before compilation, compilation and test failures with coverage enabled may report line numbers that don't correspond to the original sources. | YES | NO | YES | code-and-coverage-analysis | ||||
52 | -covermode | string | set,count,atomic | Set the mode for coverage analysis for the package[s] being tested. | The default is "set" unless -race is enabled, in which case it is "atomic". The values: set: bool: does this statement run? count: int: how many times does this statement run? atomic: int: count, but correct in multithreaded tests; significantly more expensive. Sets -cover | YES | NO | YES | code-and-coverage-analysis | |||
53 | -coverpkg | string | pattern1,pattern2,pattern3 | Apply coverage analysis in each test to packages matching the patterns. | The default is for each test to analyze only the package being tested. See 'go help packages' for a description of package patterns. Sets -cover. | YES | NO | YES | code-and-coverage-analysis | |||
54 | -vet | string | list | Configure the invocation of "go vet" during "go test" to use the comma-separated list of vet checks. | If list is empty, "go test" runs "go vet" with a curated list of checks believed to be always worth addressing. If list is "off", "go test" does not run "go vet" at all. | YES | NO | YES | code-and-coverage-analysis | |||
55 | ||||||||||||
56 | ||||||||||||
57 | ||||||||||||
58 | ||||||||||||
59 | ||||||||||||
60 | ||||||||||||
61 | ||||||||||||
62 | ||||||||||||
63 | ||||||||||||
64 | ||||||||||||
65 | ||||||||||||
66 | ||||||||||||
67 | ||||||||||||
68 | ||||||||||||
69 | ||||||||||||
70 | ||||||||||||
71 | ||||||||||||
72 | ||||||||||||
73 | ||||||||||||
74 | ||||||||||||
75 | ||||||||||||
76 | ||||||||||||
77 | ||||||||||||
78 | ||||||||||||
79 | ||||||||||||
80 | ||||||||||||
81 | ||||||||||||
82 | ||||||||||||
83 | ||||||||||||
84 | ||||||||||||
85 | ||||||||||||
86 | ||||||||||||
87 | ||||||||||||
88 | ||||||||||||
89 | ||||||||||||
90 | ||||||||||||
91 | ||||||||||||
92 | ||||||||||||
93 | ||||||||||||
94 | ||||||||||||
95 | ||||||||||||
96 | ||||||||||||
97 | ||||||||||||
98 | ||||||||||||
99 | ||||||||||||
100 | ||||||||||||
101 | ||||||||||||
102 | ||||||||||||
103 | ||||||||||||
104 | ||||||||||||
105 | ||||||||||||
106 | ||||||||||||
107 | ||||||||||||
108 | ||||||||||||
109 | ||||||||||||
110 | ||||||||||||
111 | ||||||||||||
112 | ||||||||||||
113 | ||||||||||||
114 | ||||||||||||
115 | ||||||||||||
116 |