Skip to main content
Welcome to your Go learning journey. This tutorial is structured like a book, where each chapter builds upon the previous one to help you master Go programming step by step.

Why Go?

Go (Golang) is a modern programming language designed for building reliable, efficient software. Unlike scripting languages, Go is compiled, which means your code is transformed into a standalone executable that runs blazingly fast.
Go distinguishes between a library and an application. The package main declaration tells the compiler: “This is a runnable app!” This explicit distinction helps prevent common mistakes and makes your code’s purpose clear.

What makes Go different?

Go was designed with simplicity and safety in mind:
  • No undefined errors: Every variable has a default “zero value” - no garbage memory
  • Built-in concurrency: Run thousands of tasks simultaneously with goroutines
  • Fast compilation: Build times measured in seconds, not minutes
  • Garbage collection: Automatic memory management without manual allocation
  • Rich standard library: Build web servers, work with JSON, handle files - all built-in

Start your journey

This tutorial is organized into chapters that progressively build your Go skills. Start with the fundamentals and work your way through.

Hello world

Write your first Go program and understand the basic structure

Values

Learn about Go’s fundamental data types: strings, integers, floats, and booleans

Variables

Discover how to store and manipulate data using variables

Constants

Work with immutable values that never change

How to use this tutorial

1

Read each chapter

Start from the beginning and work through each concept systematically
2

Run the examples

Type out the code examples yourself - don’t just copy and paste. This builds muscle memory
3

Experiment

Modify the examples and see what happens. Breaking things is a great way to learn
4

Build projects

Apply what you’ve learned by building small projects after each section

Prerequisites

To follow along with this tutorial, you’ll need:
  • Go installed on your computer (download from golang.org)
  • A text editor or IDE (VS Code with Go extension is recommended)
  • Basic familiarity with using a terminal or command line
You can verify Go is installed by running go version in your terminal. You should see output showing the Go version number.

The learning path

This tutorial covers everything from basics to advanced topics:
  1. Fundamentals: Hello World, values, variables, constants
  2. Control flow: Conditionals and loops
  3. Data structures: Arrays, slices, and maps
  4. Functions: Regular and variadic functions
  5. Advanced concepts: Pointers, structs, and interfaces
  6. Concurrency: Goroutines and channels
  7. Real-world project: Building a web server
Let’s begin your Go journey with your first program!

Build docs developers (and LLMs) love