-n | Print the commands but do not run them |
-v | Print the names of packages as they are compiled |
-x | Print the commands |
-tags <tags> | A comma-separated list of build tags to consider satisfied during the build |
-toolexec <cmd> | A program to use to invoke toolchain programs like vet and asm |
-a | Force rebuilding of packages that are already up-to-date |
-p <programs> | The number of programs, such as build commands or |
-race | 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) |
-msan | 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 |
-work | Print the name of the temporary work directory and
do not delete it when exiting |
-asmflags <flag...> | Arguments to pass on each go tool asm invocation |
-buildmode <mode> | Build mode to use. See 'go help buildmode' for more |
-compiler <name> | Name of compiler to use, as in runtime.Compiler (gccgo or gc) |
-gccgoflags <flag...> | Arguments to pass on each gccgo compiler/linker invocation |
-gcflags <flag...> | Arguments to pass on each go tool compile invocation |
-installsuffix <suffix> | A suffix to use in the name of the package installation directory, |
-ldflags <flag...> | Arguments to pass on each go tool link invocation |
-linkshared | Build code that will be linked against shared libraries previously |
-mod <mode> | Module download mode to use: readonly, vendor, or mod |
-modcacherw | Leave newly-created directories in the module cache read-write |
-modfile <file> | In module aware mode, read (and possibly write) an alternate go.mod file instead of the one in the module root directory |
-overlay <file> | Read a JSON config file that provides an overlay for build operations |
-pkgdir <dir> | Install and load all packages from dir instead of the usual locations |
-trimpath | Remove all file system paths from the resulting executable |