0

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.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
me24hour
  • 629
  • 3
  • 8
  • 15

1 Answers1

0

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 :)

AvnishSingh
  • 488
  • 3
  • 10