Golang
Curriculum
Go · Golang

Go (Golang) Tutorial

A complete Go programming path from beginner to pro - syntax, concurrency, APIs, databases, testing, and real projects. Clear, practical, section by section.

65 lessonsBeginner → ProProgramming
Start from the beginning

Curriculum

Work through each section in order. Every lesson ends with practice and key points so the idea sticks.

Beginner

Getting Started

5 lessons · ~54 min
  1. 1
    What is Go (Golang)?

    Learn what Go is, why developers use it, and what kinds of programs beginners can build with it.

  2. 2
    Install Go & Set Up Your Editor

    Install modern Go, check your terminal, and prepare an editor for beginner-friendly Go development.

  3. 3
    Your First Go Program

    Write, save, and run a small Go program using package main, imports, and fmt.Println.

  4. 4
    Go Modules & go.mod

    Understand Go modules, create a go.mod file, and learn why modules are the default for modern Go projects.

  5. 5
    go run, build, fmt & Tooling

    Use the most important Go commands for running, building, formatting, testing, and inspecting beginner projects.

Beginner

Foundations

4 lessons · ~43 min
  1. 6
    Variables & Short Declaration

    Learn how to create variables with var, short declaration, type inference, and assignment.

  2. 7
    Basic Types

    Understand Go basic types including strings, integers, floats, booleans, and how to inspect them.

  3. 8
    Constants & iota

    Use constants for fixed values and learn how iota can create simple related numeric constants.

  4. 9
    Operators

    Learn Go arithmetic, comparison, logical, and assignment operators with practical examples.

Beginner

Working with Data

3 lessons · ~40 min
  1. 10
    Strings & Runes

    Work with Go strings, string length, indexing, raw strings, and Unicode runes.

  2. 11
    Arrays & Slices

    Learn the difference between fixed-size arrays and flexible slices, including append, len, cap, and range.

  3. 12
    Maps

    Use maps to store key-value data, check for missing keys, update values, and delete entries.

Beginner

Control Flow

2 lessons · ~25 min
  1. 13
    if, else & switch

    Control program decisions with if, else if, else, and switch statements.

  2. 14
    for Loops (Go’s Only Loop)

    Use Go for loops as counters, while-style loops, infinite loops, and range loops.

Beginner

Functions & Scope

3 lessons · ~37 min
  1. 15
    Functions

    Write reusable Go functions with parameters, return values, and clear names.

  2. 16
    Multiple Return Values

    Learn how Go functions return more than one value and why this pattern is central to error handling.

  3. 17
    Pointers

    Understand what pointers are, how to use &, *, and when pointer parameters are useful.

Beginner

Types & Composition

3 lessons · ~40 min
  1. 18
    Structs

    Group related fields into custom struct types for users, orders, products, and service data.

  2. 19
    Methods

    Attach functions to types with methods and understand value and pointer receivers.

  3. 20
    Interfaces Intro

    Learn the beginner idea behind Go interfaces: behavior described by method sets.

Beginner

Project Basics

4 lessons · ~54 min
  1. 21
    Packages & Imports

    Organize Go code into packages, import standard library packages, and understand exported names.

  2. 22
    Error Handling the Go Way

    Handle errors explicitly with error return values, nil checks, and clear control flow.

  3. 23
    defer, panic & recover

    Use defer for cleanup and understand when panic and recover appear in Go programs.

  4. 24
    fmt, input & basic I/O

    Print formatted output, read beginner terminal input, and understand basic standard input/output ideas.

Beginner

Putting It Together

1 lessons · ~15 min
  1. 25
    Mini CLI: Tip Calculator

    Put beginner Go skills together by building a small command-line tip calculator.

Intermediate

Stronger Go

3 lessons · ~36 min
  1. 26
    Interfaces in Practice

    Use Go interfaces to design small contracts, accept behavior instead of concrete types, and keep packages easy to test.

  2. 27
    Embedding & Composition

    Build larger Go types by composing smaller structs and interfaces instead of relying on inheritance.

  3. 28
    Generics Basics

    Write reusable Go functions and types with type parameters while keeping constraints simple and readable.

Intermediate

Concurrency

5 lessons · ~66 min
  1. 29
    Goroutines

    Run functions concurrently with goroutines and understand how lightweight concurrent work differs from parallel execution.

  2. 30
    Channels

    Communicate between goroutines with channels, including sends, receives, buffering, closing, and range loops.

  3. 31
    select Statements

    Wait on multiple channel operations and implement timeouts, cancellation, and non-blocking communication.

  4. 32
    sync Package (WaitGroup, Mutex)

    Coordinate goroutines with sync.WaitGroup and protect shared data with sync.Mutex.

  5. 33
    context Package

    Use context.Context to carry cancellation, deadlines, and request-scoped values through Go programs.

Intermediate

Quality

3 lessons · ~36 min
  1. 34
    Testing with testing package

    Write focused Go unit tests using the standard testing package, test file naming, and helpful assertions.

  2. 35
    Table-Driven Tests

    Use table-driven tests to cover many inputs clearly with less repetition and better failure names.

  3. 36
    Benchmarks & Coverage Basics

    Measure Go code with benchmarks and use coverage reports to see which lines your tests execute.

Intermediate

Data & I/O

2 lessons · ~25 min
  1. 37
    JSON Encoding & Decoding

    Convert Go structs to and from JSON using encoding/json, struct tags, streams, and validation checks.

  2. 38
    Working with Files

    Read, write, append, and scan files using os, io, bufio, and path/filepath from the standard library.

Intermediate

Networking

5 lessons · ~69 min
  1. 39
    HTTP Client

    Make outbound HTTP requests with net/http, timeouts, context, headers, JSON decoding, and response handling.

  2. 40
    net/http Server Basics

    Create HTTP handlers, write responses, parse requests, and run a server with sensible timeouts.

  3. 41
    Routing Patterns

    Organize routes with ServeMux, method checks, path parameters, route groups, and lightweight router libraries.

  4. 42
    Middleware Patterns

    Wrap HTTP handlers to add logging, recovery, authentication checks, request IDs, and shared behavior.

  5. 43
    Building a REST API

    Combine routing, JSON, validation, handlers, and status codes to build a small REST API in Go.

Intermediate

Persistence

2 lessons · ~30 min
  1. 44
    database/sql Basics

    Use the standard database/sql package for connections, queries, commands, rows, scanning, and transactions.

  2. 45
    PostgreSQL with Go

    Connect Go applications to PostgreSQL using environment-based connection strings, migrations, queries, and safe configuration.

Intermediate

App Structure

3 lessons · ~36 min
  1. 46
    Env Vars & Configuration

    Load application configuration from environment variables with validation, defaults, and safe secret handling.

  2. 47
    Structured Logging

    Use Go 1.21 log/slog for structured logs that are readable locally and useful in production systems.

  3. 48
    Standard Project Layout

    Organize Go applications with packages, cmd directories, internal code, configuration, tests, and migrations.

Advanced

Deep Go

4 lessons · ~67 min
  1. 49
    Concurrency Patterns (worker pools, pipelines)

    Use goroutines, channels, context cancellation, worker pools, and pipelines to build practical concurrent Go programs.

  2. 50
    Performance Mindset & Profiling

    Learn how to improve Go performance with measurement, benchmarks, pprof, allocation awareness, and practical optimization habits.

  3. 51
    Memory & Garbage Collector Basics

    Understand stack vs heap, escape analysis, garbage collection, slices, memory retention, and safe memory habits in Go.

  4. 52
    Reflection (When You Really Need It)

    Use the reflect package carefully for struct tags, generic utilities, validation, and framework-style code.

Advanced

Production

4 lessons · ~67 min
  1. 53
    Security Essentials for Go Services

    Protect Go services with secure HTTP defaults, validation, parameterized SQL, secrets management, timeouts, and safe error handling.

  2. 54
    Dockerizing Go Apps

    Package Go services with multi-stage Docker builds, small runtime images, environment configuration, and container-friendly practices.

  3. 55
    Deploying Go Services

    Prepare Go services for production deployment with config, graceful shutdown, health checks, migrations, logging, metrics, and release discipline.

  4. 56
    gRPC Intro (Conceptual + Small Example)

    Understand where gRPC fits, how Protocol Buffers define APIs, and what a small Go gRPC service looks like.

Advanced

Pro Architecture

2 lessons · ~32 min
  1. 57
    Structuring Larger Go Services

    Organize larger Go codebases with clear packages, dependency direction, small interfaces, config, handlers, services, repositories, and tests.

  2. 58
    Advanced Tooling (vet, staticcheck mindset)

    Use Go tooling like gofmt, go test, go vet, staticcheck, govulncheck, race detection, coverage, and CI as a production quality system.

Advanced

Capstone Projects

3 lessons · ~60 min
  1. 59
    Mini Project: Task CLI

    Build a small task manager command-line application with modules, JSON persistence, commands, error handling, and a clean file structure.

  2. 60
    Mini Project: JSON REST API

    Build a small JSON REST API with net/http, routing, JSON helpers, an in-memory store, validation, and curl-based testing.

  3. 61
    Mini Project: Background Worker

    Build a background worker with a job queue, worker goroutines, retries, context cancellation, graceful shutdown, and structured logs.

Advanced

Polish & Next Steps

4 lessons · ~54 min
  1. 62
    Common Go Mistakes (and Fixes)

    Avoid common Go bugs around nil maps, defer, contexts, goroutines, loop variables, channels, errors, mutexes, and shadowing.

  2. 63
    Go Ecosystem & Useful Libraries

    Explore the Go ecosystem, standard library strengths, popular libraries, dependency selection, and when to keep things simple.

  3. 64
    Building a Go Portfolio

    Design portfolio projects that prove production Go skills: APIs, CLIs, workers, databases, tests, Docker, deployment, and clear documentation.

  4. 65
    What to Learn After Go

    Plan your next growth path after Go: systems design, databases, distributed systems, Kubernetes, observability, security, and open source.