What is Go?
Go is a programming language made at Google. Three engineers, Robert Griesemer, Rob Pike and Ken Thompson, started it in 2007, and Google released it to the public in 2009. You will often see it called Golang, because the word "Go" alone is hard to search for on the web.
Go was made for writing servers and tools that large teams build together. Docker and Kubernetes, two well-known tools for running programs on servers, are written in Go.
Go is a compiled language
The computer cannot run Go code as you write it. It only understands machine code, a long list of very simple instructions. A program called a compiler translates your Go code into machine code first. Then the machine code runs.
The compiler also checks your code before it runs. If you misspell a name or break a rule of the language, it shows an error, and no part of your program runs. Go's compiler is strict. That can feel annoying at first, but every mistake it catches is one that cannot happen while your program is running.
A small language
Go has few keywords and a short list of rules. For example, it has only one loop keyword, for. This makes Go one of the easier languages to learn, and Go code written by different people tends to look alike. Go even comes with a tool, gofmt, that sets the spacing of every file in the same way.
Your first Go program
Here is a complete Go program:
package main
import "fmt"
func main() {
fmt.Println("Hello, Go!")
}
Output:
Hello, Go!
The line with fmt.Println prints the text between the double quotes. The other lines are the frame that every Go program needs. Do not worry about them yet. The next lesson explains each one.
The code editor in this course runs Go 1.22, and every output you see in these lessons came from running the code on it.
Your first exercise is already complete. Hit Submit and watch Go print the same greeting.