"go run" is going in infinite loop using sublime text 3

161 Views Asked by At

I am trying to run go code in sublime text 3.

package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello, playground")
}

However, when I go under Tools -> Build I see that the program goes in infinite loop.

GoSublime r17.03.05-1 9o: type `help` for help and command documentation

[ `go run main.go` ⌛ ]
[ ~/Documents/SublimeWorkspace/ ] # 

Please let me know what I might be missing here.

1

There are 1 best solutions below

0
On

Open sublime Goto Tools->Build System-> New build System. Paste below lines in the file and save by some_name.sublime-build

{
"shell_cmd": "go run $file",
"shell":true
}

Goto Tools->Build system-><select-your-build or automatic>

Goto Tools->Build

Done cheers :)