Setting up Golang on your macOS system can seem daunting, but with this step-by-step guide, you’ll be coding in no time. Golang, or Go, is renowned for its simplicity and efficiency, making it a top choice for developers worldwide. Follow these steps to get started:
.pkg
file in your Downloads folder and double-click to open it..bash_profile
, .zshrc
, or .bashrc
, depending on your shell configuration. nano ~/.zshrc
GOPATH
and update the PATH
: export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
source ~/.zshrc
go version
You should see the installed version of Go printed on the terminal.
mkdir -p $GOPATH/src/hello
cd $GOPATH/src/hello
nano hello.go
hello.go
: package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
go run hello.go
You should see Hello, World!
displayed, confirming that Go is set up correctly.
For more detailed guides on the Golang installation process on various operating systems, visit the following resources:
- Golang Installation Guide
- Golang Installation on Mac
- Linux Golang Installation Guide
- Golang Installation on Windows
- Golang Installation on Kali Linux
By following this step-by-step guide, you’ll have Golang installed and ready to use on your macOS in 2025. Happy coding!