Why Go?
Go (often called Golang) is an open-source programming language created at Google in 2007 and released to the public in 2009. It was designed by Robert Griesemer, Rob Pike, and Ken Thompson to address the challenges of modern software development at scale.
Go is known for being:
- Fast — Compiles to native machine code
- Simple — Clean syntax with only 25 keywords
- Concurrent — Built-in goroutines and channels
- Efficient — Garbage collected, yet lightweight
Installing Go
Windows
- Download the MSI installer from go.dev/dl
- Run the installer and follow the prompts
- The installer will set up
GOROOTand add Go to yourPATH
macOS
# Using Homebrewbrew install go
# Or download the .pkg installer from go.dev/dlLinux
# Download the tarballwget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz
# Extract to /usr/localsudo tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz
# Add to PATHecho 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrcsource ~/.bashrcVerifying Installation
Open a terminal and run:
go versionYou should see output like:
go version go1.23.0 windows/amd64Understanding Key Environment Variables
| Variable | Purpose |
|---|---|
GOROOT | Where Go is installed (usually /usr/local/go) |
GOPATH | Where your Go projects and dependencies live |
GOBIN | Where compiled binaries are placed |
Modern Go (1.16+) uses modules by default, so you don’t need to set GOPATH for most projects anymore.
Your First Project Structure
myapp/├── go.mod├── main.goCreate go.mod:
go mod init myappThis creates a module definition file that tracks your dependencies.
Next Steps
Now that Go is installed, let’s write your very first program: Hello, World!