Go Hello World

June 26, 2019

Steps:

  • Create a new folder called hello-world
  • Create a new file called main.go inside the folder hello-world
  • Open main.go with Sublime Text or Atom
  • Copy code to main.go
  • Run the code in a Termial

Code:

package main

import "log"

func main() {
    log.Println("hello world")
}


Run:

cd hello-world
go run main.go


Output:

2019/06/26 15:29:18 hello world