×

go · level 1 · unit 1 · lesson 2

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

Every Go program sits in the same frame.

Here is the frame, line by line. says this is a program you can run. brings in fmt, a toolbox for showing text. func main() { is where your program starts, and the last } is where it ends.

Your instructions go in between. shows whatever is inside its brackets, then moves to a new line. You will write this frame every time, so it soon feels like home.

Words go inside double quote marks, like "Hello, world!". A piece of text in quotes is called a . The quotes tell Go where the text starts and stops, and they are not shown.

package main
import "fmt"
func main() {
	fmt.Println("Hello, world!")
}

Always use double quotes for a string, because single quotes mean something different in Go.