Go Tutorial: Getting Started
Write your first Go program. No setup required — just you and the editor.
Your first Go program
In ten steps you will go from zero to writing real code.
No theory upfront. No vocabulary tests. Just you, a text editor, and a computer that listens.
Each step takes about 30 seconds. Do them in order.
Let's go.
What you'll learn in this Go getting started tutorial
This interactive Go tutorial has 10 hands-on exercises. Estimated time: 10 minutes.
- Run your first program — The code is already written.
- Make it say something different — The computer prints whatever you put inside the quotes.
- Print two lines — One `fmt.Println()` prints one line.
- Print three lines — Add one more. Three `fmt.Println()` calls, three lines of output.
- Where your program starts — `func main()` is the entry point of every Go program.
- The import line — `import "fmt"` loads a built-in Go package called fmt.
- Spot the mistake — Something in this code is wrong.
- Another bug to fix — This one has a different problem.
- Write a program from scratch — The main block is empty.
- Chapter 1 done — You know the shape of a Go program.
Go Getting Started concepts covered
- Your first Go program