Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go-Sublime-build configuration

Im having issues trying to set up go to run the current file from Sublime text 2. Here's what I have in my go.sublime-build file

{
    "cmd": [ "go", "run", "${file}" ]
}

When I try to run build on a go source file, I get the error

[Error 6] The handle is invalid
[cmd:  [u'go run', u'C:\\Users\\gprasant\\Documents\\GitHub\\programming_pearls\\src\\go\\quicksort.go']]
[dir:  C:\Users\gprasant\Documents\GitHub\programming_pearls\src\go]

Is there any way to get this fixed ? Or is there another plugin in Sublime text for Go development?

like image 324
gprasant Avatar asked Dec 11 '12 09:12

gprasant


People also ask

How do I create a build system in Sublime Text?

Sublime Text is able to run build programs such as 'make', either when a key in pressed (F7 by default), or when a file is saved. The build system to use can be select from the Tools/Build System menu. If a project is open, the selected build system will be remembered for the project.

How do I run Golang in Sublime Text?

Open the Sublime Text command palette by pressing Ctrl+Shift+P . Run the Package Control: Install Package command. Type Golang Build and hit Enter to install the package.

How do I edit a build in Sublime Text 3?

sublime-build , and it will now be accessible in the build system menu. Select it, hit Ctrl B to build, and then hit Ctrl Shift B to run the resulting program. Or you can use a Build and Run option and call it by hitting Ctrl B , then selecting that option.


1 Answers

Installing GoSublime should get this working for you. After installing and restarting ST2: do ctrl-B, type "run" and hit enter.

like image 164
GeertJohan Avatar answered Oct 19 '22 14:10

GeertJohan