Introduction to Go

Discover what the Go programming language is, its origins at Google, its strengths for cloud and network services, and the traits that define it.

Learning objectives

  • Explain what Go is and where it comes from
  • List the kinds of software Go is best suited for
  • Recognise Go's key design traits as a language

Go (often called Golang) is an open source programming language for building fast, reliable software. It is compiled, statically typed and garbage collected, and it ships with first-class support for concurrency. This lesson explains what Go is, where it came from, and why so many teams choose it.

What is Go?

Go is a general-purpose language designed to be simple to read and quick to compile. A single go build command turns your source code into one self-contained binary with no external runtime to install, which makes Go programs easy to ship and deploy.

The language deliberately keeps a small feature set: there are no classes, no inheritance and no exceptions. Instead, Go gives you structs, interfaces, functions and a lightweight concurrency model. That small surface area is a feature — it keeps code consistent and approachable across large teams.

A short history

Go was designed at Google starting in 2007 by Robert Griesemer, Rob Pike and Ken Thompson, who wanted a language that compiled quickly and scaled to large codebases. The project was released as open source in 2009, and the stable Go 1.0 version arrived in 2012 with a promise of backward compatibility that still holds today.

Since then Go has become one of the most popular languages for cloud and infrastructure software. Tools you may already use — Docker, Kubernetes and Terraform among them — are written in Go.

What Go is good for

Go shines wherever you need efficient, networked programs that are easy to deploy and maintain:

  • Network services and APIs, thanks to a strong standard library for HTTP.
  • Command-line tools (CLIs), distributed as a single binary per platform.
  • Cloud and infrastructure software, where fast startup and low memory use matter.
  • Concurrent workloads, handled with goroutines and channels.

Key traits at a glance

TraitWhat it means for you
CompiledSource becomes native machine code
Statically typedTypes are checked at compile time, catching bugs
Garbage collectedMemory is freed automatically
Built-in concurrencyGoroutines and channels are part of the language
Single binaryNo runtime to install alongside your program
Fast compilationLarge projects still build in seconds

A first taste of Go

You do not need to understand every detail yet. The single line below prints a message to the terminal:

fmt.Println("Hello, Go!")

Wrapped in the smallest complete program, it looks like this — and it compiles and runs as-is:

package main

import "fmt"

func main() {
	fmt.Println("Hello, Go!")
}

You will write and run this program yourself in the next two lessons.

Common misconceptions

  • “Go is the same as Google Go / Golang.” It is one language; “Golang” is just a nickname that comes from its old website address, golang.org.
  • “Go is object-oriented like Java.” Go has no classes or inheritance; it favours composition with structs and interfaces instead.
  • “Go needs a heavy runtime.” A compiled Go program is a standalone binary — there is no virtual machine or interpreter to install on the target machine.

Practice

Without running anything yet, predict what the program in “A first taste of Go” prints. Then write the smallest complete Go program that prints Go is fun! on its own line.

Show the solution

The example prints Hello, Go!. A program that prints Go is fun! looks like this:

package main

import "fmt"

func main() {
	fmt.Println("Go is fun!")
}

Every runnable Go program starts in package main and runs the main function; fmt.Println writes a line to the terminal.

Summary

  • Go is a compiled, statically typed, garbage-collected open source language.
  • It was created at Google, open sourced in 2009, and reached 1.0 in 2012.
  • It excels at network services, CLIs and cloud infrastructure, and it builds fast into a single portable binary.

Ready to try it? Next, follow installing Go on your machine, then write your first Go program. You can also browse the full Go course.

Your progress is stored only in this browser. No account is required.

Search

Search runs entirely in your browser.