GO-BUILD(1) | General Commands Manual | GO-BUILD(1) |
go - tool for managing Go source code
go build [-o output] [ build flags ] [ packages ]
Build compiles the packages named by the import paths, along with their dependencies, but it does not install the results.
If the arguments are a list of .go files, build treats them as a list of source files specifying a single package.
When the command line specifies a single main package, 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 build flags are shared by the build, install, run, and test commands:
For more about specifying packages, see go-packages(7).
For more about where packages and binaries are installed, see go-gopath(1).
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others).
2012-05-13 |