Hello World Go

06.09.2019

Cookbook: Hello World Go

If you are just getting started with Go, or have may have just forgotten, here is a quick reference for building a basic go program.

First create the directory and file

mkdir HelloWorldGo
cd HelloWorldGo
touch main.go

Then, use the following Go code.

package main

import "fmt"

func main() {
    fmt.Println("Hello World!")
}

And run the code with the following command.

go run main.go