A comprehensive, hands-on tutorial for learning Go from basics to production-ready services.
- Fundamentals (01-08): Syntax, data structures, functions, interfaces, error handling
- Intermediate (09-13): Packages, concurrency, testing, file I/O, HTTP
- Production APIs (14-19): REST, Uber FX, middleware, validation, config
- Database (20-26): PostgreSQL, GORM, migrations, relationships
- Complete Service (27): Full production API with FX + GORM + PostgreSQL
- Best Practices (28-30): Code organization, documentation, standards
- Monorepo (31-33): Go workspaces, CI/CD pipelines
- Advanced (34-36): Docker, performance, production patterns
# Clone and create a learning branch
git clone <repo-url>
cd learn-go
git checkout -b my-learning
# Start with the basics
cd 01-getting-started
go run hello.goStandalone files (01-13):
cd 02-basic-syntax
go run variables.goModules (14-36):
cd 14-rest-api-fundamentals
go mod download
go run .Tests:
cd 11-testing
go test -v ./...Each beginner folder includes practice challenges:
- Read the
README.md - Try
challenge.goyourself - Compare with
challenge-solution.go
- 01-getting-started - Hello World and setup
- 02-basic-syntax - Variables, types, constants
- 03-control-flow - If/else, loops, switch
- 04-functions - Functions, closures, defer
- 05-data-structures - Slices, maps, structs
- 06-pointers - Pointers and references
- 07-interfaces - Interfaces and polymorphism
- 08-error-handling - Error patterns
- 09-packages-modules - Go modules and packages
- 10-concurrency - Goroutines and channels
- 11-testing - Tests and benchmarks
- 12-file-io - File operations and JSON
- 13-http-basics - HTTP servers and clients
- 14-rest-api-fundamentals - REST with chi router
- 15-dependency-injection-fx - Uber FX basics
- 16-api-with-fx-structure - API architecture with FX
- 17-middleware-with-fx - Middleware patterns
- 18-request-validation - Input validation
- 19-configuration-logging - Config and structured logging
- 20-postgresql-setup - PostgreSQL installation
- 21-database-basics - SQL and database/sql
- 22-gorm-introduction - GORM ORM
- 23-migrations-setup - Database migrations
- 24-gorm-crud-operations - CRUD operations
- 25-gorm-relationships - Model relationships
- 26-gorm-advanced - Transactions and hooks
- 27-production-api-service - Complete production API
- 28-code-organization - Project structure
- 29-documentation-standards - Go documentation
- 30-go-standards-resources - Community standards
- 31-monorepo-introduction - Monorepo concepts
- 32-monorepo-local-setup - Go workspaces
- 33-monorepo-advanced - CI/CD pipelines
- 34-docker-containerization - Docker best practices
- 35-performance-optimization - Profiling and optimization
- 36-production-patterns - Production-ready patterns
This course is designed for use with Cursor, an AI-powered code editor.
Ask questions directly in your editor (Cmd+L or Ctrl+L):
- "How do I handle errors in Go?"
- "Explain the FX dependency injection in folder 15"
- "I'm stuck on the challenge in folder 03"
Cursor's AI searches this repo, the web, and official Go docs to provide contextual answers.
Add new topics while maintaining quality:
Ask: "Add folder 37-grpc following the same pattern"
Cursor follows the guidelines in .cursor/rules/ to ensure consistency.
Create separate branches for experiments:
git checkout -b experiment/new-features
git checkout -b practice/challengesThis keeps the original course clean for reference.
- Language: Go 1.21+
- Router: chi
- DI Framework: Uber FX
- ORM: GORM
- Database: PostgreSQL
- Migrations: golang-migrate
- Logging: zerolog
- Config: viper
- Validation: go-playground/validator
Contributions welcome! See .cursor/rules/guideline.mdc for standards.
- Create numbered folder (e.g.,
37-new-topic/) - Include
README.mdand code examples - Follow existing patterns
- Update this README
Format your changes before committing:
make format # Format Go + Markdown
make format-go # Go only
make format-md # Markdown onlyOr install tools manually:
- Go:
gofmt -s -w . - Markdown:
prettier --write "**/*.md"
- "The Go Programming Language" by Donovan & Kernighan
- "Learning Go" by Jon Bodner
Created by: Lingxi Li - Built with Cursor AI for learning production Go development. This course was created to support professional development while exploring an interactive, customizable learning methodology.
Inspired by:
- Official Go tutorials
- Production Go patterns from leading tech companies
- The Go community
Ready to start? β 01-getting-started