O'Reilly logo

Go: Design Patterns for Real-World Projects by Mat Ryer, Mario Castro Contreras, Vladimir Vivien

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building packages

The Go tools reduce the complexity of compiling your code by applying certain conventions and sensible defaults. Although a full discussion of Go's build tool is beyond the scope of this section (or chapter), it is useful to understand the purpose and use of the build and install tools. In general, the use of the build and install tools is as follows:

$> go build [<package import path>]

The import path can be explicitly provided or omitted altogether. The build tool accepts the import path expressed as either fully qualified or relative paths. Given a properly setup workspace, the following are all equivalent ways to compile package volt, from the earlier example:

$> cd $GOPATH/src/github.com/vladimirvivien/learning-go $> go build ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required