Skip to content

🚀 Es una colección de lecciones y ejemplos prácticos para aprender Go desde cero. | A collection of lessons and practical examples to learn Go from scratch.

License

Notifications You must be signed in to change notification settings

marlonbarreto-git/golang-lessons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Course: From Zero to Ninja 2026

Complete Go (Golang) course updated to 2026 with 132 chapters organized in 19 parts, covering everything from Hello World to Go Assembly, WASM, and major Go projects like Docker and Kubernetes. Includes best practices, design patterns, the entire standard library, golang.org/x/ packages, and the latest language features (Go 1.23, 1.24, 1.25, 1.26).

Author: Marlon Barreto (mbarretot@hotmail.com)

Prerequisites

  • Basic programming knowledge
  • Go 1.24+ installed (download)
  • Code editor (VS Code with Go extension, GoLand, or Neovim)

Course Structure

Part I: Language Basics

# Topic Description
001 Hello World First program, go run, go build, basic structure
002 Variables & Constants Data types, declarations, zero values, inference
003 Operators Arithmetic, logical, comparison, bitwise
004 Conditionals if/else, ternary pattern, early return
005 Loops for, range, break, continue, labels
006 Switch switch/case, type switch, fallthrough
007 Functions Parameters, returns, variadic, closures, defer
008 Pointers Memory addresses, references, nil
009 Strings Strings, runes, bytes, unicode, strings package
010 Collections Arrays, slices, maps, common operations

Part II: Data Structures Deep Dive

# Topic Description
011 Slices Deep Dive Internals, capacity growth, memory layout, subslice gotchas
012 Maps Deep Dive Internals, Swiss Tables (Go 1.24), iteration, nil vs empty
013 Sort Package sort.Slice, sort.Interface, binary search, custom comparators
014 Container Types container/heap, container/list, container/ring
015 Slices, Maps & Cmp Modern slices/maps/cmp packages (Go 1.21+)

Part III: Types and OOP

# Topic Description
016 Structs Definition, fields, embedding, methods
017 Interfaces Definition, implicit implementation, composition
018 Type System Alias, wrappers, type assertions, type switch
019 Enums & Iota iota, enum patterns, String()
020 Generics Type parameters, constraints, when to use
021 Method Sets & Receivers Value vs pointer receivers, interface satisfaction rules
022 Interface Internals iface/eface, nil interfaces, comparable constraint

Part IV: Error Handling

# Topic Description
023 Errors error interface, errors package, wrapping
024 Panic & Recover When to use panic, recover, defer
025 Error Patterns Sentinel errors, custom errors, best practices

Part V: Code Organization

# Topic Description
026 Packages Visibility, init(), internal, vendor
027 Init & Blank Identifier init() execution order, _ patterns, side-effect imports
028 Modules go.mod, versioning, dependencies, workspaces
029 Project Patterns Standard layout, clean architecture, DDD

Part VI: Concurrency

# Topic Description
030 Goroutines Creation, scheduling, WaitGroup, WaitGroup.Go()
031 Channels Buffered, unbuffered, directionality
032 Select Multiplexing, timeouts, default
033 Context Cancellation, timeouts, values, propagation
034 Sync Package Mutex, RWMutex, Once, Pool, Map, Cond
035 Concurrency Patterns Worker pools, fan-in/out, pipelines

Part VII: Testing

# Topic Description
036 Testing testing package, table-driven tests, subtests
037 Benchmarks Benchmarking, b.Loop(), profiling
038 Mocking Interfaces, testify, gomock
039 Fuzzing Fuzz testing, corpus, coverage

Part VIII: Standard Library Essentials

# Topic Description
040 I/O Patterns io.Reader/Writer, bufio, streaming, fs
041 Strings & Strconv strconv deep dive, strings.Builder, Cut, Fields
042 Bytes Package bytes.Buffer, bytes.Reader, zero-copy techniques
043 Time Parsing, formatting, timezones, monotonic clock
044 Regexp Patterns, named groups, RE2, performance
045 Encoding JSON, XML, gob, CSV, binary, base64, hex
046 Templates text/template, html/template, FuncMap, composition
047 OS, Exec & Processes os/exec, signals, environment, process management
048 Flag Package Custom flags, FlagSet, subcommands, env fallback
049 Path & Filepath path vs filepath, Walk, WalkDir, Glob
050 Unicode & UTF-8 utf8, utf16, rune classification, encoding/decoding
051 Hash Functions fnv, crc32, crc64, adler32, maphash
052 Structured Logging log/slog deep dive, handlers, groups, performance

Part IX: Standard Library Advanced

# Topic Description
053 Math Big & Bits big.Int, big.Float, math/bits, rand/v2
054 Archive & Compress tar, zip, gzip, zlib, flate
055 Crypto AES, RSA, ECDSA, hashing, TLS, certificates
056 Net Mail & SMTP Email parsing, sending, net/rpc
057 Text Processing text/scanner, tabwriter, mime/multipart
058 Go AST Parser go/ast, go/parser, go/token, building linters
059 Advanced Testing testify, gomock, integration tests
060 Testing Stdlib testing/iotest, fstest, golden files, fixtures
061 Runtime & Debug runtime/debug, metrics, trace, binary inspection

Part X: Modern Go Features

# Topic Description
062 Iterators Range over functions (Go 1.23+), iter package
063 go:embed Embedding files, assets, templates in binary
064 Build Tags Conditional compilation, cross-platform
065 Go 1.24 Features Swiss Tables, generic aliases, FIPS 140-3
066 Go 1.25 Features WaitGroup.Go(), JSON v2, synctest
067 Go 1.26 Features SIMD experimental, crypto/hpke

Part XI: Advanced Language

# Topic Description
068 Reflection reflect package, use cases, performance
069 Code Generation go generate, stringer, mockgen, sqlc
070 Unsafe unsafe.Pointer, uintptr, valid use cases
071 CGO Calling C from Go, callbacks, performance
072 Go Assembly Plan 9 assembly, SIMD, optimization
073 Plugin & Expvar Go plugins, expvar monitoring, /debug/vars
074 WebAssembly WASM, syscall/js, WASI, TinyGo, wazero

Part XII: Design Patterns & Architecture

# Topic Description
075 Design Patterns Functional options, DI, graceful shutdown
076 Resilience Rate limiting, circuit breaker, bulkhead
077 Event-Driven CQRS, event sourcing, saga, outbox
078 API Design Versioning, OpenAPI, pagination, ETags
079 Security OWASP, input validation, secure headers

Part XIII: Web & Networking

# Topic Description
080 Networking TCP/UDP, TLS/mTLS, DNS, net package
081 Web Backend net/http, chi, fiber, middleware, REST
082 HTTP Client Timeouts, pooling, retries, middleware
083 WebSockets Real-time communication, gorilla/websocket
084 gRPC Protocol Buffers, services, streaming
085 GraphQL gqlgen, schema design, subscriptions
086 Authentication JWT, OAuth2, OIDC, password hashing
087 CLI Applications cobra, bubbletea, TUI
088 Desktop Apps fyne, wails, native GUI

Part XIV: Data, Databases & Messaging

# Topic Description
089 Databases database/sql, pgx, gorm, migrations
090 Redis & Caching go-redis, cache patterns, invalidation
091 Message Queues Kafka, NATS, RabbitMQ, event-driven
092 Data Processing gonum, arrow, parquet, ETL
093 Images & Audio image stdlib, gocv, bild, beep, oto

Part XV: golang.org/x/ Ecosystem

# Topic Description
094 x/sync errgroup, singleflight, semaphore
095 x/net & x/crypto http2, html parsing, ssh, bcrypt, argon2
096 x/text transforms, language tags, collation, normalization
097 x/oauth2 & x/term OAuth2 flows, terminal I/O, raw mode
098 x/sys & x/mod Platform syscalls, semver, modfile
099 x/tools go/analysis, custom analyzers, goimports

Part XVI: Production & Deployment

# Topic Description
100 Performance Profiling, escape analysis, optimization
101 Observability Logging, metrics, tracing, OpenTelemetry
102 Debugging Delve, race detector, memory leaks, pprof
103 CI/CD & Tooling Makefile, GitHub Actions, goreleaser
104 Deploy Docker, Kubernetes, cloud-native
105 AI & ML gonum, gorgonia, langchaingo, ONNX
106 Final Project Complete integrator project

Part XVII: Major Go Projects

Each chapter studies a real-world Go project: architecture, patterns, optimizations, Go philosophy, and includes a simplified working version.

# Project Description
107 Docker Container runtime, namespaces, cgroups, layered FS
108 Kubernetes Controller pattern, reconciliation loops, informers
109 etcd Raft consensus, distributed KV, WAL
110 Terraform DAG dependency resolution, IaC, plugin architecture
111 Prometheus Pull-based metrics, time-series DB, PromQL
112 Grafana Plugin architecture, dashboards, data sources
113 Caddy Automatic HTTPS, module system, clean API
114 Hugo Content pipeline, template engine, static site generation
115 Traefik Dynamic reverse proxy, provider pattern, load balancing
116 CoreDNS Plugin chain, DNS server, middleware composition
117 Consul Gossip protocol, service discovery, health checking
118 Vault Secrets management, seal/unseal, encryption
119 CockroachDB Distributed SQL, range partitioning, transactions
120 NATS Pub/sub messaging, request/reply, queue groups
121 Minio S3-compatible object storage, erasure coding
122 Gitea Full-stack Go web app, Git service
123 Badger/BoltDB Embedded KV: LSM tree vs B+ tree
124 Cilium eBPF networking, kernel-level packet processing
127 Ollama Local LLM serving, model management, streaming API
128 TiDB Distributed SQL, Raft consensus, MySQL compatible
129 Istio Service mesh control plane, xDS, mTLS, traffic routing
130 Milvus Vector database, similarity search, HNSW index, AI/RAG

Part XVIII: Advanced Testing & Modern Features

# Topic Description
131 Property Testing Property-based testing, testing/quick, generators, shrinking
132 JSON v2 encoding/json/v2, strict mode, omitzero, migration from v1

Part XIX: Philosophy & Mastery

# Topic Description
125 Go Proverbs Go philosophy, common mistakes, idiomatic patterns
126 Mastery Path Career paths, community, contributing to Go, resources

How to Use This Course

  1. Sequential: Follow chapters in order for maximum learning
  2. By topic: Jump to specific topics as needed
  3. Practice: Each chapter has progressive examples

Running the Examples

# Navigate to chapter
cd 001_hello_world

# Run directly
go run main.go

# Or compile and run
go build -o program
./program

Code Conventions

  • Early return: Always prefer early returns over nesting
  • Error handling: Handle errors immediately after the call
  • Naming: Short and descriptive names (idiomatic Go)
  • Comments: Only when code is not self-explanatory

Go Versions Covered

Version Release Key Features
Go 1.23 Aug 2024 Range over func, unique package
Go 1.24 Feb 2025 Swiss Tables, generic aliases, FIPS 140-3
Go 1.25 Aug 2025 WaitGroup.Go(), JSON v2, synctest
Go 1.26 Feb 2026 SIMD experimental, crypto/hpke

Coverage

  • Language: Variables, types, functions, pointers, structs, interfaces, generics, errors, concurrency
  • Standard Library: 100+ packages covered (io, fmt, strings, bytes, strconv, time, regexp, encoding, crypto, net, os, hash, math, archive, compress, text, mime, testing, runtime, debug, log/slog, container, sort, slices, maps, cmp, flag, path, filepath, unicode, plugin, expvar, go/ast)
  • golang.org/x/: sync, net, crypto, text, oauth2, term, sys, mod, tools
  • Web: HTTP server/client, gRPC, WebSockets, GraphQL, REST APIs
  • Data: databases, Redis, Kafka, NATS, RabbitMQ, CSV, JSON, XML, Parquet
  • Apps: CLI, desktop, AI/ML, images, audio, data processing, WASM
  • Architecture: Design patterns, DI, CQRS, event sourcing, resilience
  • Security: OWASP, JWT, OAuth2, OIDC, crypto, TLS/mTLS
  • Production: Performance, profiling, observability, deploy, CI/CD
  • Major Projects: Docker, Kubernetes, etcd, Terraform, Prometheus, Grafana, Caddy, Hugo, Traefik, CoreDNS, Consul, Vault, CockroachDB, NATS, Minio, Gitea, Badger/BoltDB, Cilium

Additional Resources

License

MIT License - Free for educational and commercial use.

About

🚀 Es una colección de lecciones y ejemplos prácticos para aprender Go desde cero. | A collection of lessons and practical examples to learn Go from scratch.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages