Chapter 1 of 20
Getting Started
Intro to Go, installing the toolchain, and your first program
What is Go
Go (also called Golang) is a statically compiled language open-sourced by Google in 2009. It emphasizes a concise syntax, a built-in concurrency model (goroutines / channels), fast compilation, and single-binary deployment. It is widely used for backend services, CLI tools, and cloud-native infrastructure — Docker, Kubernetes, and Prometheus are all written in Go.
Installation
Download the installer from the official site, set up your PATH, and verify the version:
$ go version
go version go1.22.0 windows/amd64Hello World
Create a file hello.go:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}Run it:
$ go run hello.go
Hello, World!Initialize a Module
Go 1.11+ uses Go Modules for dependency management. The first step for a new project:
$ mkdir myapp && cd myapp
$ go mod init example.com/myapp