Go Tutorial · Go Basics · Lesson 1 of 30

Go Introduction

What Go is, why it's popular for back-end services and what a Go program looks like.

What is Go?

Go (often called Golang) is an open-source language created at Google in 2009. It's designed to be simple, fast and reliable for building software at scale:

  • Compiled to a single native binary — easy to deploy, starts instantly.
  • Statically typed with a small, readable syntax.
  • Built-in concurrency with goroutines and channels.
  • A strong standard library: HTTP servers, JSON, testing, crypto.

Go powers Docker, Kubernetes, Terraform, Prometheus and countless back-end APIs and command-line tools.

Hello, World!

Hello, World!
package main

import "fmt"

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

Output

Hello, World!

Run this on your computer — see “Get Started” for setup.

Every Go program starts in package main with a func main(). Go examples on this site show the program and its output — copy any example into main.go and run it with go run main.go.

Test yourself

Which function is the entry point of a Go program?

  1. init()
  2. main() in package main
  3. start()
  4. Main()
Show answer

Answer: main() in package main