This page lists the commands provided by this package and the arguments they accept.
The golang_build
command executes various go
commands and accepts the
following args:
task
: A string of the build task to perform. Accepts the following values:"build"
: executesgo build -v
"run"
: executesgo run -v {current_filename}
"test"
: executesgo test -v
"benchmark"
: executesgo test -v -bench=.
"install"
: executesgo install -v
"clean"
: executesgo clean -v
"cross_compile"
: executesgo build -v
withGOOS
andGOARCH
set
flags
: A list of strings to pass to thego
executable as flags. The list of valid flags can be determined by executinggo help {task}
in the terminal.
The golang_build_get
command executes go get -v
and accepts the following
args:
url
: A string of the URL to get, instead of prompting the user for it.flags
: A list of strings to pass to thego
executable as flags. The list of valid flags can be determined by executinggo help get
in the terminal.
The golang_build_terminal
command opens a terminal to the directory containing
the currently open file. The command does not accept any args.
The following JSON structure can be added to the file opened by the Preferences > Key Bindings – User menu entry.
[
{
"keys": ["super+ctrl+g", "super+ctrl+t"],
"command": "golang_build",
"args": {
"task": "test",
"flags": ["-x"]
}
}
]
The following JSON structure can be added to
Packages/User/Default.sublime-commands
. The Packages/
folder can be located
by the Preferences > Browse Packages... menu entry.
[
{
"caption": "Go: Test (Print Commands)",
"command": "golang_build",
"args": {
"task": "test",
"flags": ["-x"]
}
}
]