CS-WIKI101
Loading...
Searching...
No Matches
golang

Go Installation Guide

Go is an open-source programming language developed by Google that makes it easy to build simple, reliable, and efficient software.

NOTE Tested on macOS Sonoma 14.0

Step 1: Install Homebrew

NOTE If you already have Homebrew installed, you can skip these steps.

Follow the instructions provided in the installation homebrew to install Homebrew on macOS.

Step 2. Install Go

Go is an open-source programming language developed by Google. Follow the steps below to install Go on macOS:

  1. Open Terminal.

    ‍For more information please see how to open Terminal in macOS

  2. Install Homebrew by follow the instructions provided in
  3. the installation homebrew to install Homebrew on macOS.
  4. Once Homebrew is installed, run the following command to install Go:

    brew install go

    > NOTE > Install go using the command above will install the latest version of Go. If you want to install a specific version of Go, you can run the following command:

    brew install go@<version>
  5. After the installation is complete, verify that Go is installed correctly by running the command:

    go version

    You should see the Go version information.

    $ go version
    + go version go1.21.3 darwin/arm64

Additional Step: Setting up Go Environment

you can set GOPATH and GOROOT by adding the following lines to your ~/.bash_profile or ~/.zshrc

export GOPATH="$HOME/.go" # or any other directory you want
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"

References

Source Description
Go Go website
Go Documentation Go documentation
Go Tutorial Go tutorial
Setup your workspace The GOPATH and PATH environment variables

Need assistance? Check out my discussion board or review the GitHub status page.

© 2023 AppleBoiy • Code of Conduct • [MIT License](LICENSE)

Back to Top