The New Default. Your hub for building smart, fast, and sustainable AI software

See now
Go gopher mascot walking along a dotted path toward stacked steps, illustrating first steps in learning Golang

Golang Beginner's Guide: How to Install Go and Write Your First Program

Grzegorz Hajdukiewicz
|   Updated Oct 18, 2026

To start with Go (Golang), install it from go.dev or open the online Go Playground, write a ten-line "Hello, World!" program, and run it with go run. That's about 15 minutes of work.

Go is a compiled, statically typed language created at Google, with a small syntax and a large standard library, which makes it one of the easier backend languages to pick up.

This guide covers when Go is worth learning, how to install it and how to write your first program. It ends with the features and resources to learn next.

Executive Summary

Go is a good first backend language if you want to build APIs, command-line tools or cloud infrastructure. Its small syntax and built-in tooling get you from installation to a running program in minutes.

In the 2025 Go Developer Survey, 91% of developers said they were satisfied working with Go, and CLIs and API services were the most common use. Go isn't the right choice for everything, though.

It's a poor fit for user interfaces, and its error handling is the most common complaint among developers.

Why Learn Go in 2026?

Go is worth learning if you work on backend services, developer tooling or cloud infrastructure, because that's where it's used most. Docker, Kubernetes and Terraform are written in Go, and companies such as Google, Uber, Netflix, PayPal and Cloudflare have published case studies on using it in production.

What makes Go practical to learn:

  • Go is a small language, with few keywords and usually one obvious way to do something, so code written by different people looks similar and is easy to review.

  • Concurrency is cheap. Add the go keyword before a function call and it runs as a goroutine. Goroutines are managed by the Go runtime rather than the operating system and start with a 2 KB stack (Go 1.4 release notes), so a program can run thousands of them at once.

  • The standard library ships with an HTTP server, JSON handling and testing, so you can build a working web service without any third-party packages.

Go also has limits. It isn't used for frontend or mobile UI work, its data science and ML ecosystem is far smaller than Python's, and its explicit error handling feels verbose to many newcomers. On popularity, Go sits at #11 in the TIOBE Index for October 2026, down from #8 a year earlier. It's a solid, established language, not a fast-growing one. If you're deciding between Go and Python, see our Go vs. Python comparison. For Go's history, read our Golang 101 guide.

What Do You Need to Start Programming in Go?

To start programming in Go, you need either a local Go installation and a code editor, or just a web browser:

  • For a local setup (recommended), install Go (see the next section) and a code editor. Visual Studio Code with the official Go extension gives you autocompletion, automatic imports and formatting on save.

  • The Go Playground at go.dev/play runs Go in the browser with nothing to install. It's enough for your first programs, but you can't use it for real projects with multiple files or your own dependencies.

How to Install Go on Windows, macOS and Linux

Download the installer for your system from go.dev/dl. At the time of writing, the current release is Go 1.27 (release history). The steps below follow the official installation guide.

How to install Go on Windows

  1. Download the .msi installer from go.dev/dl, open it and follow the prompts.

  2. Close and reopen any open Command Prompt windows.

  3. Open Command Prompt (Start menu → type cmd → Enter) and run:

go version

If the command prints the installed version, Go is ready.

How to install Go on macOS

  1. Download the .pkg installer. Choose the ARM64 version for Apple Silicon Macs (M-series) or x86-64 for older Intel Macs.

  2. Open the package and follow the prompts. It installs Go to /usr/local/go and adds /usr/local/go/bin to your PATH.

  3. Open a new Terminal window and run go version to confirm the installation.

How to install Go on Linux

  1. Download the .tar.gz archive for your architecture.

  2. Remove any previous installation and extract the archive into /usr/local (you may need sudo). Replace the file name with the one you downloaded:

rm -rf /usr/local/go && tar -C /usr/local -xzf go1.27.0.linux-amd64.tar.gz

Don't extract the archive into an existing /usr/local/go folder, as this is known to break installations.

  1. Add Go to your PATH by adding this line to $HOME/.profile (or /etc/profile for a system-wide install):

export PATH=$PATH:/usr/local/go/bin
  1. Run source $HOME/.profile (or log out and back in), then run go version to confirm the installation.

How to Write and Run Your First Go Program

To write your first Go program, create a module, add a hello.go file with a main function, and run it with go run ..

  1. Create a folder for the project and initialize a module, which lets Go track your dependencies:

mkdir hello
cd hello
go mod init example/hello
  1. Create a file called hello.go in that folder and paste in this code:

package main

import "fmt"

func main() {
	fmt.Println("Hello, World!")
}
  1. Run it from the terminal (in VS Code, use the built-in terminal):

go run .

You should see Hello, World! printed in the terminal.

Here's what each part does:

  • package main tells Go this package builds an executable program rather than a library.

  • import "fmt" loads the standard library's formatting package, which handles printing text.

  • func main() is the entry point. Go starts running the program here.

  • fmt.Println prints a line of text to the terminal.

In the Go Playground, delete the sample code, paste in the program and click Run. The Format button tidies your code using Go's standard formatting.

Which Go Features Should Beginners Learn Next?

After "Hello, World!", the most useful next steps are Go's type system, its built-in tooling, and concurrency, in that order.

  • Go checks types at compile time, so many bugs show up before the program runs, and type declarations double as documentation.

  • Go's built-in tools cover the basics: gofmt formats your code, go test runs tests written with the standard testing package, and go doc shows documentation for any package. You can also browse the standard library on pkg.go.dev.

  • Go returns errors as ordinary values instead of throwing exceptions. Get comfortable with the if err != nil pattern early, because you'll write it constantly.

  • Learn goroutines and channels once the basics feel natural. They're Go's main advantage, and also the easiest place to write subtle bugs.

Good free resources to learn Go:

For questions, the Gophers community has a Slack workspace you can join via an invite.

Key Takeaways

  • You can install Go and run your first program in about 15 minutes.

  • Go fits best for APIs, CLIs and cloud infrastructure, not UI or data science.

  • Use go mod init and go run . from day one, as the official tutorial does.

  • Goroutines are cheap (2 KB initial stack), but learn the basics before concurrency.

  • Go is a stable top-15 language; pick it because it fits your project.

Where Should You Go From Here?

Learning Go starts with a working setup and a few small programs, but it pays off when you build something real: an API, a CLI or an internal tool. Pick a small project close to your actual work and use the language's own conventions (gofmt, tests, explicit errors) from the start. If your team is weighing Go for a new backend or wants help building one, talk to Monterail about whether it fits your product.

Golang for Beginners FAQ

Grzegorz Hajdukiewicz avatar
Grzegorz Hajdukiewicz
Chief Delivery Officer
Linkedin
With over a decade of experience in the IT industry, Grzegorz has a proven track record of delivering complex projects on time and on budget. At Monterail, he leads a team of dozens of developers, designers, project managers, and business analysts, ensuring the successful delivery of software solutions for clients worldwide. Passionate about agile methodologies and continuous improvement, he constantly seeks new ways to optimize the delivery process.