The primary functionality of the Golang Build package is the Golang Build build system. It includes a number of what Sublime Text refers to as “variants.” It also includes a couple of regular Sublime Text commands for common, related tasks.
To use the Golang Build build system, open the Tools > Build System menu and select Golang Build.
The variants included with the build system include:
go buildgo testgo installgo build with GOOS and GOARCH setgo cleanOnce the Golang Build build system is selected, the command palette can be used to run any of the variants.
On Sublime Text 3, the command palette entries will be:
Build with: Golang BuildBuild with: Golang Build - TestBuild with: Golang Build - InstallBuild with: Golang Build - Cross-Compile (Interactive)Build with: Golang Build - CleanOn Sublime Text 2, the command palette entries will be:
Build: BuildBuild: TestBuild: InstallBuild: Cross-Compile (Interactive)Build: CleanIf a build is running and needs to be stopped, the command palette will contain an extra entry Golang Build: Cancel.
If the output panel for a build is closed, it can be re-opened by using the command palette to run Golang Build: Reopen Output. Once a new build is started, the old build output is erased.
In addition to the build system variants, two other command palette commands are available:
Golang Build: Get, which executes go get after prompting for a URLGolang Build: Terminal, which opens a terminal and sets relevant Go environment variablesTo control the environment variables used with the build system, please read the configuration documentation.
For information on the available commands, their arguments and example key bindings and command palette entries, please read the commands documentation.