Go
Full course · 21 lessonsGo is a statically typed, compiled language designed at Google for building simple, reliable, and efficient software at scale. It excels at backend services, microservices, APIs, and concurrent systems.
Getting Started with Go
Install Go, set up GOPATH, understand workspaces, write Hello World, and explore the Go toolchain.
Variables, Constants, and Basic Types
Variable declarations, zero values, constants, iota, basic types, and type conversions.
Control Flow: if, for, switch
For loops, if with statement, switch expressions, type switches, and defer/panic/recover.
Functions and Multiple Return Values
Function declarations, multiple return values, named returns, variadic functions, closures, and function values.
Arrays, Slices, and Range
Array declarations, slice mechanics (make, append, copy), slice internals, and the range keyword.
Maps and Structs
Map creation and operations, structs, struct embedding, tags, and JSON serialization.
Methods and Interfaces
Method declarations, pointer vs value receivers, interface types, interface satisfaction, and the empty interface.
Pointers and Memory
Pointer types, new function, stack vs heap, escape analysis, and unsafe pointer operations.
Errors, Panic, and Recover
The error interface, custom errors, error wrapping, panic/recover, and error handling patterns.
Packages and Modules
Package declarations, import paths, go modules, versioning, and publishing packages.
Goroutines and Channels
Launch goroutines with go keyword, create and use channels for communication, use select for multiplexing, understand goroutine scheduling and leaks.
sync Package: Mutex, WaitGroup, Once, Pool
Use sync.Mutex and RWMutex for thread safety, sync.WaitGroup for goroutine coordination, sync.Once for one-time initialization, sync.Pool for object reuse.
Context: Cancellation and Timeouts
Create contexts with Background, TODO, WithCancel, implement timeouts and deadlines with WithTimeout, pass request-scoped values through context.
Testing: testing Package and Table-Driven Tests
Write unit tests with testing.T, use table-driven tests, write benchmarks with testing.B, use go test flags and coverage.
I/O: Readers, Writers, and File Operations
Use io.Reader and io.Writer interfaces, work with files via os package, use bufio for buffered I/O, use io.Copy, io.MultiReader, io.TeeReader.
JSON, Encoding, and Serialization
Marshal and unmarshal JSON with encoding/json, use struct tags for JSON field mapping, write custom JSON marshalers/unmarshalers.
HTTP Server, Client, and Middleware
Build HTTP servers with net/http, handle requests with ServeMux routers, make HTTP requests with http.Client, write middleware pattern.
Reflection and Generics (Go 1.18+)
Use reflect package for runtime type inspection, write generic functions with type parameters, use constraints for type bounds.
Modules, Packages, and Dependency Management
Create and publish Go modules, manage versions with go mod and semantic versioning, use workspaces for multi-module projects.
Building CLI Tools with flag and cobra
Use flag package for command-line flags, use cobra for complex CLI applications, handle os.Args and subcommands.
Low-Level Programming, unsafe, and CGo
Use the unsafe package for low-level memory manipulation, call C code with cgo, understand Go's memory model and GC.
Free Books
Learn Go with Tests
An exceptional open-source book that teaches Go fundamentals through Test-Driven Development.
Go by Example
A hands-on introduction using annotated example programs. The fastest way to grasp Go syntax.
The Little Go Book
A concise conceptual overview covering Go types, interfaces, concurrency, and tooling.
Official Documentation
Go Documentation Hub
Central home for all official tutorials, guides, references, and release notes.
Effective Go
Essential reading for writing clear idiomatic Go code covering formatting, naming, and concurrency patterns.
Go Language Specification
The ultimate source of truth detailing Go syntax, types, and operational behavior.

