What Is the Go Programming Language? A Simple Guide to the Language of the Cloud
A friendly, jargon-free guide to Go, the simple and fast programming language Google created for the cloud. Learn what goroutines are, why Go programs are a single file, and how Go came to power Docker, Kubernetes and much of the internet.

On this page
When you stream a video, order a ride or open a website, there's a good chance some of the software answering you behind the scenes is written in Go. You've probably never seen it, but it quietly runs a big part of the modern internet: the tools that package apps, manage cloud servers and handle millions of requests per second.
Go was created at Google to be simple like Python but fast like C, and to be very good at doing many things at the same time. This article explains, in plain language, what Go is, why it was made, what makes it special, and where it's used.
Why Google made a new language
By 2007, Google had enormous programs written mostly in C++, Java and Python, running on thousands of computers. Each language had a problem:

- C++ produced fast programs, but it was complicated, and building a big C++ program could take many minutes. One of Go's creators, Rob Pike, has said the idea for Go took shape while waiting for a huge C++ program to compile.
- Python was pleasant to write, but too slow for some of Google's busiest systems.
- And computers were gaining more and more processor cores, but none of these languages made it easy to use them all at once.
So three Google engineers, Robert Griesemer, Rob Pike and Ken Thompson, set out to design something better. Ken Thompson was already a legend: he co-created the Unix operating system and the B language, the direct ancestor of C (see What Is the C Programming Language?).
Go was announced to the world as free, open-source software in 2009, and Go 1.0 arrived in 2012.
Small on purpose
Most languages grow by adding features. Go's designers did the opposite: they kept the language small, so it's quick to learn and every Go program looks familiar. Go has only 25 keywords (special reserved words like if, for and func), fewer than most popular languages.
Here's the classic first program:
1package main
2
3import "fmt"
4
5func main() {
6 fmt.Println("Hello, world!")
7}package main says this is a program you can run, import "fmt" brings in the formatting toolbox, and func main() is where the program starts. It prints Hello, world!.
Go doesn't have classes like Java or C#. Instead, you describe data with a struct (a bundle of named values) and attach actions to it:
1type Car struct {
2 Color string
3 Speed int
4}
5
6func (car *Car) Accelerate() {
7 car.Speed += 10
8}
9
10func main() {
11 myCar := Car{Color: "red"}
12 myCar.Accelerate()
13 myCar.Accelerate()
14 fmt.Printf("My %s car is going %d km/h\n", myCar.Color, myCar.Speed)
15}This prints My red car is going 20 km/h. The := sign creates a variable and lets Go figure out its type on its own, so you get the safety of types without having to spell them out everywhere.
Go even settles arguments about style: it comes with a tool called gofmt that automatically formats your code the one official way. Spaces, line breaks and alignment are never up for debate, so all Go code looks alike.
The superpower: goroutines
Go's most famous feature is how easily it does many things at once. Imagine making breakfast. You could brew the coffee, wait three minutes, and only then start the toast. Or you could start both and let them work side by side.
In Go, you start a task "on the side" by writing the word go in front of it. That creates a goroutine, a lightweight task that runs alongside the rest of your program:
1func makeCoffee(done chan string) {
2 time.Sleep(3 * time.Second)
3 done <- "Coffee is ready"
4}
5
6func makeToast(done chan string) {
7 time.Sleep(2 * time.Second)
8 done <- "Toast is ready"
9}
10
11func main() {
12 start := time.Now()
13 done := make(chan string)
14
15 go makeCoffee(done)
16 go makeToast(done)
17
18 fmt.Println(<-done)
19 fmt.Println(<-done)
20 fmt.Printf("Breakfast ready in %.0f seconds\n", time.Since(start).Seconds())
21}When we ran it, it printed:
Toast is ready
Coffee is ready
Breakfast ready in 3 seconds
Three seconds instead of five, because both jobs ran at the same time. The toast finished first, so its message arrived first.
The other new idea here is the channel (chan), a pipe that goroutines use to pass messages to each other. Each job drops a message into the done channel when it's finished, and <-done waits until a message comes out. A popular Go saying sums up the idea: "Don't communicate by sharing memory; share memory by communicating." Instead of several tasks fighting over the same data, they hand results to each other, like cooks passing plates through a kitchen window.
Goroutines are also cheap. Each one starts with just a few kilobytes of memory, and Go juggles them across the computer's cores for you. On our laptop, a test program started 100,000 goroutines at once in about half a second. That's why a single Go server can handle a huge number of visitors at the same time, giving each one its own goroutine.
Using every core
Goroutines aren't just for waiting on slow things. They can also split up heavy work. We counted the prime numbers below 2 million in a Go program, sharing the work among more and more goroutines:

With 16 goroutines, the same job finished almost 7 times faster, and the program barely changed: a few goroutines picking up blocks of numbers from a channel. The gains level off at the end, partly because a laptop's cores share heat and power, and some of them are smaller, slower cores built to save battery.
Is Go fast?
Yes. Go is a compiled language: before running, your code is translated into the computer's own machine language, like C. We timed the same simple job, counting the prime numbers below 2 million with just one worker, in five languages:

Go finished in 0.39 seconds, essentially tied with C and JavaScript on this small test, and about 45 times faster than plain Python. To be fair to every language, the Go version used the same 32-bit numbers as the C and Java versions. With Go's default, larger 64-bit numbers, it took 0.56 seconds, because dividing bigger numbers is a little slower for the processor.
Go is also famous for fast builds. Even large Go programs typically compile in seconds, which was one of its original goals. (See What Is the Python Programming Language? for why plain Python is so much slower, and how it gets around that.)
One file that runs anywhere
Another reason people love Go is how easy it is to share a finished program:

- One file:
go buildpacks your program and everything it needs into a single file. Our "Hello, world!" became a 2 MBhello.exethat runs on any Windows computer, no installation required. - Any computer: from the same Windows laptop, changing two settings produced versions for Linux and for Mac. Building for another system is called cross-compiling, and Go makes it trivial.
That's a big deal for servers: instead of installing a language, libraries and matching versions on every machine, you copy one file and run it.
Where Go is used

- Docker packs apps into containers, neat bundles that run the same way on any computer. It's written in Go.
- Kubernetes, created at Google, runs and coordinates huge numbers of containers across data centers. Also Go.
- Terraform lets engineers describe the cloud servers they want in a text file and creates them automatically.
- Companies like Cloudflare, Uber, Twitch and Google use Go for busy back-end services.
- Ollama, a popular app for running AI language models on your own computer, is written in Go.
- Handy command-line tools like GitHub's gh and the Hugo website builder are Go programs, shipped as a single file.
Because so much cloud software is written in it, Go is often called "the language of the cloud".
The downsides
Go doesn't use "exceptions" to signal problems. Instead, functions return an error that you check right away. Here, we try to turn the text "forty" into a number:
1age, err := strconv.Atoi("forty")
2if err != nil {
3 fmt.Println("That's not a number:", err)
4 return
5}This prints That's not a number: strconv.Atoi: parsing "forty": invalid syntax. That brings us to Go's weak spots:
- Repetitive error handling. Checking errors this way is clear and explicit, but
if err != nilappears so often that it's a running joke among Go programmers. - Simple can mean limited. Go deliberately leaves out features other languages have. It took until 2022 to add generics (a way to write one piece of code that works with many types), one of the most requested features.
- Not built for everything. Go is rarely used for phone apps, desktop apps with windows and buttons, games, or AI research, where other languages have better tools.
- Not the absolute fastest. Go's garbage collector and safety checks cost a little speed, so for the most demanding work, like game engines or operating systems, C, C++ and Rust are usually chosen.
A short history

A fun milestone: in 2015, the Go compiler, the program that turns Go code into machine code, was itself rewritten in Go. When a language can build itself, programmers say it's self-hosting.
Should you learn Go?
- Great reasons: you want to build web servers, back-end services, cloud tools or command-line programs, or you'd like to work with Docker and Kubernetes. Go is also a nice second language: small enough to learn in a few weeks, with clear rules.
- Good to know: Go is free and runs on Windows, Mac and Linux. The official website, go.dev, has an online playground where you can write and run Go code in your browser, plus a free interactive tour of the language.
A small glossary
- Go (Golang): a programming language created at Google, announced in 2009.
- Compiled language: a language whose code is translated into machine code before it runs.
- Struct: a bundle of named values, like a car's color and speed.
- gofmt: the tool that formats Go code the one official way.
- Goroutine: a lightweight task that runs alongside the rest of a program, started with the word
go. - Channel: a pipe that goroutines use to send messages to each other.
- Concurrency: handling many tasks at the same time.
- Core: one of the processing units inside a computer's processor. Modern processors have many.
- Garbage collector: the part of Go that frees memory a program no longer uses.
- Cross-compiling: building a program on one kind of computer for another kind.
- Container: a neat bundle with an app and everything it needs, run by tools like Docker.
- Generics: a way to write code once that works with many types of values.
Wrapping up
Go was born from frustration with slow builds and complicated code at Google, and it answered with a small, readable language that compiles in seconds and runs nearly as fast as C. Its signature trick, goroutines, makes doing many things at once as simple as typing go, and its single-file programs are a joy to ship to servers.
It doesn't try to be everything, and its error checks can feel repetitive. But if you've used a modern website or app today, there's a good chance a little Go program somewhere was busy helping, many things at once.
Read next

What Is the Swift Programming Language? A Simple Guide to the Language Behind iPhone Apps
A friendly, jargon-free guide to Swift, the programming language Apple created for iPhone, iPad and Mac apps. Learn why it replaced Objective-C, how optionals prevent crashes, how an app is made, and how fast Swift really is.

What Is the Rust Programming Language? A Simple Guide to the Fast Language That Won't Let You Crash
A friendly, jargon-free guide to Rust, the programming language that is as fast as C but stops whole families of memory bugs before a program ever runs. Learn about ownership, why tech giants are adopting it, and where it is used.

What Is the Python Programming Language? A Simple Guide to the Language Behind Data Science and AI
A friendly, jargon-free guide to Python, the easy-to-read programming language behind data science and AI. Learn why it uses indentation, how it can be slow and fast at the same time, and why it became the most popular language in the world.
Comments
Be kind and specific. Comments with links from new accounts appear after a moderator reviews them.