The Go Primer

Chapter 1: Getting Started

Introduction

Go (or Golang) is an open-source, statically typed language designed at Google. It's great for building fast, concurrent services and command-line tools.

Installation

Download the binary from golang.org/dl and follow the installer for your OS. After installing, verify with go version.

Chapter 2: Core Concepts

Variables & Types

Declare variables with var x int or use the shorthand x := 42. Go has built-in types like int, string, bool, plus slices, maps, structs, and more.

Functions

Functions are first-class. Declare with func add(a, b int) int { return a + b }. Multiple return values are supported: func swap(a, b string) (string, string).