Now that we have had a quick overview of all the language features and capabilities, we can focus on how to run and build our applications.
Building and compiling programs
Install
In Go, there are different commands to build packages and applications. The first one is go install, followed by a path or a package name, which creates a compiled version of the packages in the pkg directory inside $GOPATH.
All the compiled packages are organized by the operating system and architecture, which are stored in the $GOOS and $GOARCH environment variables. These settings are visible by using the go env command, together with other information, like compilation flags:
$ go env
GOARCH="amd64"
...
GOOS="linux"...