Go build – building your Go code

The invocation stanza for go build is as follows:

go build [-o output] [build flags] [packages]

Defining an output with -o compiles a binary using a specifically named file. This is helpful when you have a particular naming convention that you want to keep for your file, or if you want to name binaries based on different build parameters (platform/OS/git SHA and others).

Packages can be defined as a list of go source files or they can be omitted. If a list of go source files is specified, the build program will use the list of files that were passed as a group that specifies a single package. If no packages are defined, the build program will validate that the packages within the directory can be built, but it will discard the results of the build.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.103.219