Setting Up GoLang

Go to the page at this link , to download the package installer for the OS of your choice.

After you download one of the recent stable releases, it will guide through the series of installation steps, and there should be it.

The installation will update the environment variable and put /usr/local/go/bin to the PATH variable. Any open terminal may need to be restarted.

Verify installation with go version in terminal. Following is my output for go version .

~ % go version go version go1.22.3 darwin/arm64

I am using VS Code as my IDE. Please install the Go Extension that VS Code prompts to install. It makes life a lot easier.

Hello World !!

Following is the Hello World code that you can run in golang. The code is also located at this link .

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

which produces the following output.

learn_golang % go run 1.helloworld/1_helloworld.go Hello World !!