Skip to main content
Please wait...
Ready, Set, Install Go: Getting Started with Golang
04 Apr, 2025

Ready, Set, Install Go: Getting Started with Golang

As you can imagine, the first step to getting started with the Golang (Go) programming language is installing Golang on your local machine. 

Step 1: Download Go 

  • Visit the official Go website at https://go.dev. Then, the official Go download page is https://go.dev/dl/. There you will be able to download the latest package file, msi file, or archive file depending on your operating system. 

     

  • Choose the appropriate installer for your operating system (Windows, macOS, or Linux). 

 

Step 2: Install Go 

Golang on Windows: 

  • Run the installer you downloaded. 

  • Follow the prompts to complete the installation. 

Golang on macOS: 

  • Open the package (.pkg) file you downloaded. 

  • Follow the installation instructions. 

Golang on Linux: 

  • Extract the tarball: 

  tar -C /usr/local -xzf go<version>.linux-amd64.tar.gz 
  
  • Add Go to your PATH environment variable: 

  export PATH=$PATH:/usr/local/go/bin 
  

Step 3: Verify Installation 

  • Open a terminal or command prompt. 

  • Run the following command for the currently installed version: 

  go version 
  

You should see the installed Go version. 

 

Step 4: Set Up Workspace 

  • Create a directory for your Go projects: 

  mkdir $HOME/go 
  
  • Set the GOPATH environment variable: 

  export GOPATH=$HOME/go 
  

Step 5: Test Your Installation 

  • Create a simple Go program: 

  package main 
 
   import "fmt" 
 
   func main() { 
       fmt.Println("Hello, Go!") 
   } 
  
  • Save the file as hello.go. 

  • Run the program: 

  go run hello.go 
  

You should see "Hello, Go!" printed in your terminal.