golangtutorialHome →

Go tutorial library

Start with the complete tutorial or choose the backend skill you need next.

Your learning progress

0 of 13 published lessons complete

Pillar · Web and APIs

Building a REST API with Go: The Complete Tutorial

Build a production-ready REST API in Go with only the standard library: net/http routing, JSON, middleware, context, graceful shutdown, and tests.

Read tutorial →
Tutorial · Concurrency

Go Context: Cancellation, Deadlines, and Request Values

Learn Go context with practical cancellation, timeout, HTTP request, and goroutine examples.

Read tutorial →
Tutorial · Web and APIs

Go HTTP Client: Timeouts, JSON, and Reliable Requests

Build reliable outbound HTTP requests in Go with client timeouts, context, JSON, status checks, body limits, and transport reuse.

Read tutorial →
Tutorial · Web and APIs

Go HTTP Middleware: Build a Production Chain

Build composable Go HTTP middleware for logging, recovery, request IDs, authentication, and timeouts.

Read tutorial →
Tutorial · Concurrency

Go Mutex: Protecting Shared State from Race Conditions

A golang mutex tutorial that proves the race first, then teaches Lock/Unlock, RWMutex, the copy bug, atomics, and the honest mutex-vs-channel call.

Read tutorial →
Tutorial · Web and APIs

Go net/http: Build an HTTP Server from Scratch

Build a production golang http server with net/http: Go 1.22 routing, PathValue, timeouts, graceful shutdown and static files, every example tested.

Read tutorial →
Tutorial · Concurrency

Go select Statement: Multiplexing Channels Explained

Learn Go's select statement with tested code: the random-choice rule, non-blocking default, timeouts, the nil-channel trick, and context cancellation.

Read tutorial →
Tutorial · Concurrency

Go Worker Pool Pattern: Bounded Concurrency at Scale

Build a Go worker pool with tested code: bounded concurrency, error propagation, context cancellation, correct channel closing, and how to size the pool.

Read tutorial →
Tutorial · Go fundamentals

Golang Hello World and Your First Go Program

Build a Golang Hello World program, understand package main and func main, accept an argument, then run and compile it with Go 1.24.7.

Read tutorial →
Tutorial · Go fundamentals

Interfaces in Go: Small Contracts That Improve Design

Learn Go interfaces, implicit satisfaction, consumer-owned contracts, nil traps, composition, and test doubles.

Read tutorial →
Tutorial · Go fundamentals

JSON in Go: Encoding, Decoding, and Validation

Encode and decode JSON safely in Go with struct tags, validation, unknown-field checks, and HTTP examples.

Read tutorial →
Tutorial · Concurrency

sync.WaitGroup in Go: Coordinating Multiple Goroutines

A tested golang waitgroup guide: the Add/Done/Wait counter model, the copy-by-value deadlock, the Add-inside-goroutine race, and Go 1.25's WaitGroup.Go.

Read tutorial →
Tutorial · Testing

Testing in Go: Table Tests, HTTP, Fakes, and Coverage

Write effective Go tests with table-driven cases, subtests, httptest, fakes, race detection, benchmarks, and useful coverage.

Read tutorial →