Last Updated: February 25, 2016
· riyadhalnur

Go Build System in Sublime Text 2

On Mac OSX,

Tools > Build System > New Build System...

Paste in the following code:

{ "cmd": ["go run '${file}'"], "selector": "source.go", "path": "/usr/local/go/bin", "shell": true }

Save the file as Go.sublime-build.

Sublime Text 2 will now recognise the file and set the build system automatically.

Press Cmd + B to build file/program.